Showing popular posts on wordpress can have a very popular affect on your blog in terms of SEO and visitor-involvement.
By giving your readers some extra links to your most popular posts you will help promote them and make them even more popular, as well as you will be adding these links across your entire site giving these posts a lot more back-links.
There are several plugins out there that will allow you to show your most popular posts, however, we believe there is a flaw in the way these work.
These plugins will typically consider posts with more comments, visits or highest rating as the most popular posts, however, this can be a problem if you define a popular post by other means.
We believe that there are 4 main factors that determine the “popularity” of your post:
We take our Popular Posts seriously, so what we do is we keep track of which posts are raking higher, receiving more traffic and getting “socialized” the most. So selecting the popular posts is all manual and figured out by us. We believe this is a much better and accurate way to do it.
With that in mind, let us show you how to do it.
Step 1
Create a new category titled “popular posts” and remember the ID number for this category.
Step 2
Locate the posts you believe to be the most popular and add them to the newly created category.
Step 3
Assuming you want to add them to the bottom of your posts, open your single.php file.
Step 4
Insert the following code right before the comments tag (<?php comments_template(); ?>)
<div id=”popularposts”>
<h3>Popular Posts</h3>
<?php $recent = new WP_Query(“cat=ID&showposts=#”); while($recent->have_posts()) : $recent->the_post();?>
<ul>
<li><a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></li>
</ul>
<?php endwhile; ?>
</div>
Step 5
Change “ID” to the id number for the “Popular Posts” category created in step 1
Change the pound symbol (#) for the number of popular posts you want to display
Step 6
Open your Stylesheet and make the appropriate changes for your newly added div container. See sample below
#popularposts{
padding: 20px 0px 20px 0px;
}
Step 7
Enjoy and link to this post!
thanks for this tips.. i will try hope is it working for me