How to display popular posts in wordpress
I came across different wordpress themes where they wont provide the popular post catogory, so this a simple tip to help you guys regarding the addition of how to display popular posts in wordpress themes.Usually the SIDEBAR.PHP is the is the best area where we can put this code.Its very simple just add the code i have given below,
- <h3>Popular Posts</h3>
- <ul>
- <?php query_posts(‘category_name=php&showposts=10′); ?>
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <li><a href=”<?php the_permalink(); ?>”>
- <?php the_title(); ?></a><br /> <?php the_excerpt(); ?>
- </li> <?php endwhile; ?>
- <?php endif; ?>
- </ul>
The above code will show the 10 most popular posts. The catagory name is optional, you can give any thing of your wish. I have given the catagory name as PHP.All that is left is to add posts to the category ‘php’. From now on, just as long as a post is in that category, it will show in this list. All you need to do is add and remove posts from this category to alter what this list displays.
Related posts:
- Display Tags in wordpress
- Speed up wordpress using .htaccess part 2
- WordPress mysql injection permalink, wp 2.8 versions security vulnerability
- WordPress Vulnerability
- Speed up wordpress using .htaccess part 1

fine..
hey cool tutorial man..
Gud one…
Gud website
nice tutorilas.