Exemplo n.º 1
0
        ?>
                    
                    
                      <div class="homeSocial">
                        <div class="share"> 
                   <?php 
        /* social calls */
        $url = get_permalink();
        ?>
                    
                    	<a href="<?php 
        comments_link();
        ?>
"><i class="icon-comments"></i> <?php 
        /*comments_popup_link( __('0', 'fairpixels'), __( '1', 'fairpixels'), __('%', 'fairpixels'));*/
        echo full_comment_count();
        ?>
</a>
                        
                        
                        
                       
                       
                      <span style="font-size:15px;"><!--&nbsp;&nbsp;&nbsp;Share:</span>  <a href="http://www.facebook.com/sharer/sharer.php?u=<?php 
        echo $url;
        ?>
"><i class="icon-facebook" style="margin-left:4px;"></i> <?php 
        //echo get_shares($url);
        ?>
</a>-->
                        
Exemplo n.º 2
0
    /**
     *display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        /* if ( $title )
        		echo $before_title . $title . $after_title; */
        if (empty($entries_display)) {
            $entries_display = '5';
        }
        $latest_category = $instance['latest_category'];
        $popular_category = $instance['popular_category'];
        $args_latest = array('cat' => $latest_category, 'post_type' => 'post', 'ignore_sticky_posts' => 1, 'posts_per_page' => $entries_display);
        ?>
		
		<script>
			jQuery(document).ready(function($) {				
				$(".widget-tab-titles li").click(function() {
					$(".widget-tab-titles li").removeClass('active');
					$(this).addClass("active");
					$(".tab-content").hide();
					var selected_tab = $(this).find("a").attr("href");
					$(selected_tab).fadeIn();
					return false;
				});
			});
		</script>

		<div class="widget-tabs-title-container">
			<ul class="widget-tab-titles" class="list">
				<!--li class="active"><h5><a href="#widget-tab1-content"><?php 
        _e('Recent', 'fairpixels');
        ?>
</a></h5></li-->
				<li class="active"><h5><a href="#widget-tab2-content"><?php 
        _e('Popular Posts', 'fairpixels');
        ?>
</a></h5></li>
				<!--li class=""><h5><a href="#widget-tab3-content"><?php 
        _e('Comments', 'fairpixels');
        ?>
</a></h5></li-->
			</ul>
		</div> 
		<div class="tabs-content-container">
			
			<!--div id="widget-tab1-content" class="tab-content" style="display: block;">	
				<?php 
        $latest_posts = new WP_Query($args_latest);
        ?>
				<?php 
        if ($latest_posts->have_posts()) {
            ?>
					<ul class="list post-list">
					<?php 
            while ($latest_posts->have_posts()) {
                $latest_posts->the_post();
                ?>
					
						<li>
							<?php 
                if (has_post_thumbnail()) {
                    ?>
							<div class="thumbnail">
								<?php 
                    the_post_thumbnail('fp75_75');
                    ?>
							</div>
							<?php 
                }
                ?>
							<div class="post-right">
								<h5>
									<a href="<?php 
                the_permalink();
                ?>
">
										<?php 
                //display only first 50 characters in the title.
                $short_title = mb_substr(the_title('', '', FALSE), 0, 50);
                echo $short_title;
                if (strlen($short_title) > 49) {
                    echo '...';
                }
                ?>
	
									</a>
								</h5>
								<div class="entry-meta">
									<span class="date">
										<i class="icon-calendar"></i>
										<?php 
                echo get_the_date();
                ?>
									</span>
									
									<?php 
                $comments = get_comments_number();
                if ($comments > 0) {
                    ?>
										<span class="comments">
											<i class="icon-comments"></i>
											<?php 
                    comments_popup_link(__('0', 'fairpixels'), __('1', 'fairpixels'), __('%', 'fairpixels'));
                    ?>
										</span>		
									<?php 
                }
                ?>
									 
								</div>
							</div>
						</li>
					<?php 
            }
            ?>
					</ul>
				<?php 
        }
        ?>
				<?php 
        wp_reset_query();
        ?>
	
			</div-->
			
			<div id="widget-tab2-content" class="tab-content" style="display: block;">
				<?php 
        $args_popular = array('cat' => $popular_category, 'post_type' => 'post', 'ignore_sticky_posts' => 1, 'posts_per_page' => 13, 'meta_key' => 'popular_order', 'orderby' => 'meta_value_num', 'order' => 'ASC');
        ?>
				<?php 
        $latest_posts = new WP_Query($args_popular);
        ?>
				<?php 
        if ($latest_posts->have_posts()) {
            ?>
					<ul class="list post-list">
					<?php 
            while ($latest_posts->have_posts()) {
                $latest_posts->the_post();
                ?>
					
						<li>
							<?php 
                if (has_post_thumbnail()) {
                    ?>
							<div class="thumbnail">
								<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_post_thumbnail('fp75_75');
                    ?>
</a>
							</div>
							<?php 
                }
                ?>
							<div class="post-right">
                            <?php 
                $popSize = '';
                // make it smaller font, don't cut it off
                $short_title = the_title('', '', FALSE);
                /*if (strlen($short_title) > 54){ 
                			echo '...'; 
                		} */
                if (strlen($short_title) > 64) {
                    $popSize = ' style="font-size:10px!important;"';
                }
                ?>
							<h5<?php 
                echo $popSize;
                ?>
>	
                            
								
									<a href="<?php 
                the_permalink();
                ?>
">
										<?php 
                /*//display only first 50 characters in the title.	
                		$short_title = mb_substr(the_title('','',FALSE),0, 50);
                		echo $short_title; 
                		if (strlen($short_title) > 49){ 
                			echo '...'; 
                		} */
                echo $short_title;
                ?>
	
									</a>
								</h5>
								<div class="entry-meta">
									<span class="date">
										<i class="icon-calendar"></i>
										<?php 
                echo get_the_date();
                ?>
									</span>
									
									<?php 
                $comments = get_comments_number();
                //if ( $comments > 0 ) {
                ?>
										<span class="comments">
											<a href="<?php 
                comments_link();
                ?>
"><i class="icon-comments"></i>
											<?php 
                /*comments_popup_link( __('0', 'fairpixels'), __( '1', 'fairpixels'), __('%', 'fairpixels'));*/
                echo full_comment_count();
                ?>
</a>		&nbsp;&nbsp;&nbsp;<!--i class="icon-facebook" style="color:#AAAAAA"></i--> <!--fb:comments-count href="<?php 
                the_permalink();
                ?>
"></fb:comments-count--><?php 
                //echo get_likes(get_permalink());
                ?>
 <div class="homeFBL2"><fb:like href="<?php 
                echo get_permalink();
                ?>
" layout="button_count" action="like" show_faces="false" share="false"></fb:like></div>
										</span>		
									<?php 
                //}
                ?>
	
								</div>
							</div>
						</li>
					<?php 
            }
            ?>
					</ul>
				<?php 
        }
        ?>
				<?php 
        wp_reset_query();
        ?>
	
			</div>
			
			<!--div id="widget-tab3-content" class="tab-content">
				<ul class="list comment-list">
					<?php 
        //get recent comments
        $args = array('status' => 'approve', 'number' => $entries_display);
        $postcount = 0;
        $comments = get_comments($args);
        foreach ($comments as $comment) {
            $postcount++;
            $commentcontent = strip_tags($comment->comment_content);
            if (strlen($commentcontent) > 50) {
                $commentcontent = mb_substr($commentcontent, 0, 49) . "...";
            }
            $commentauthor = $comment->comment_author;
            if (strlen($commentauthor) > 30) {
                $commentauthor = mb_substr($commentauthor, 0, 29) . "...";
            }
            $commentid = $comment->comment_ID;
            $commenturl = get_comment_link($commentid);
            $commentdate = get_comment_date('', $commentid);
            ?>
								
							   <li>
									<div class="thumbnail">
										<?php 
            echo get_avatar($comment, '70');
            ?>
									</div>
									<div class="post-right">
										<div class="comment-author"><h5><?php 
            echo $commentauthor;
            ?>
</h5></div>
										<div class="comment-text">
											<a<?php 
            if ($postcount == 1) {
                ?>
 class="first"<?php 
            }
            ?>
 href="<?php 
            echo $commenturl;
            ?>
"><?php 
            echo $commentcontent;
            ?>
</a>
										</div>
										<div class="entry-meta">
											<span class="date">
												<i class="icon-calendar"></i>
												<?php 
            echo $commentdate;
            ?>
											</span>
									
										</div>
									</div>
								</li>
					<?php 
        }
        ?>
					<?php 
        wp_reset_query();
        ?>
	
					
				</ul>
			</div>
		</div-->

		<div id="widget-posts-tiles">
			
		</div><!-- /tiles -->
	   <?php 
        /* After widget (defined by themes). */
        echo $after_widget;
    }