WordPress.org

Ready to get started?Download WordPress

Forums

Display popular post of last 15 days (2 posts)

  1. Robinsh
    Member
    Posted 3 years ago #

    Using a Theme Junkie theme Freshlife at my blog http://www.digmlm.com and in the sidebar there is a default option to show all time popular post, but I wanted to show popular post of last 30 days.

    I have extracted these code as below and you might help what should be change to show the last 30 days popular post.

    // Tabber: Get Most Popular Posts
    function tj_tabs_popular( $posts = 5, $size = 35 ) {
    	$popular = new WP_Query('orderby=comment_count&posts_per_page='.$posts);
    	while ($popular->have_posts()) : $popular->the_post();
    ?>
    
    <li>
     	<?php tj_show_thumb($size, $size); ?>
     	<div class="info">
     	<a>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
     	<span class="meta"><?php comments_popup_link('0 Comment', '1 Comment', '% Comments', 'comments-link', ''); ?></span>
    	</div> <!--end .info-->
    	<div class="clear"></div>
    </li>
    <?php endwhile;
    }

    Thanks

  2. ibadullah
    Member
    Posted 3 years ago #

    Do you use any instant messaging?

Topic Closed

This topic has been closed to new replies.

About this Topic