Balkhis - Vision For Success

How to display Popular Post in your wordpress sidebar

Dear Readers, I would like to thank you for reading this post. I highly value your feedback and would like to know more about my readers. Follow me on Twitter


Two Days ago I wrote a post about How to display recent posts in your wordpress sidebar and gave reasons on why one should include that. A few of the users brought up the point that displaying Popular Post is equally if not more in the benefit of the user. It is very debatable because in some cases recent post works better whereas in some cases popular post would work better. Therefore, I have decided that I will show my users to install the popular post in their wordpress as well. (Also this was requested by Bruce of Authority Directory)

Popular Post Plugin

This plugin will display popular post in your sidebars, or anywhere where you want to put this plugin. The popular post will be determined by pageviews.

This plugin would work easier for those who will use it dynamically with the widget in the admin panel. If you want to include this somewhere else other than the sidebar of the template, you can still do it. I have added a very useful article to Balkhis which shows How to add Dynamic Sidebar in wordpress. Basically follow that tutorial, if you want to display it in some other place than your sidebar, but want to use the widget area in the admin panel. All what you would have to do is paste the last code discussed in that tutorial anywhere on the template for instance footer or whatnot.

Once you have done that,

Download the plugin

Upload the plugin, Activate it.

Go to your Themes section and click on the sub menu that says Widgets.

Add this widget into your selected sidebar, and customize it. You are good to go.

Now If you don’t have any issues with codes and can edit those very well, than you can also take the approach of doing it simply the codes way rather than the widget way.

You can display this code anywhere in your template:

<?php if (function_exists(‘WPPP_show_popular_posts’)) WPPP_show_popular_posts(); ?>

This is just a basic code that will show popular post. You would still have to download and activate the plugin.

You can also add multiple parameters to make your plugin customized.

title (title of the widget, you can add tags (e.g. <h3>Popular Posts</h3>) default: Popular Posts)

number (number of links shown, default: 5)

days (length of the time frame of the stats, default 0, i.e. infinite)

show (can be: both, posts, pages; default both)

format (the format of the links shown, default: <a href=’%post_permalink%’ title=’%post_title%’>%post_title%</a>)

For the format there are more variables also.

%post_permalink% the link to the post

%post_title% the title the post

%post_title_attribute% the title of the post; use this in attributes, e.g. <a title=’%post_title_attribute%’…

%post_views% number of views

For more information on this visit: FAQ Page

Hopefully this helps you guys.



To stay updated with the blog, please consider subscribing to my full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox. I hate spam as well, so I promise you that you will not be spammed.
Add to Social Bookmarks:
Add this Article to Digg Add this Article to Stumbleupon Add this Article to Del.icio.us Add this Article to Reddit Add this Article to Newsvine Add this Article to Technorati

RSS feed

12 Comments

Comment by Authority Directory
2008-05-15 12:16:27

Very nice Syed – Now that I finally added entrecard my next task I have set is to upgrade to the new version of wordpress. I know it is supposed to be easy, but I always am concerned about messing something up that I can’t fix.

Then I can workout adding the most popular posts you convered here. :)


Comment by Syed Balkhi
2008-05-15 12:34:51

lol you know How to IM me if you screw up … just make sure you backup everything before you upgrade :)


Comment by Authority Directory
2008-05-16 13:10:07

Well the upgrade is done and I was chatting with you via im the whole time…. It was very smooth. Thanks for the help!

(Comments wont nest below this level)

 
 
 
Comment by Tech blog
2008-05-15 12:51:55

so you now think thats its more important than recent posts. :lol: j/k

Thanks for the informative post.


Comment by Syed Balkhi
2008-05-15 18:14:24

Never said i think it is more important ….

I said some users think it is … I am one of those who think it might be equal


Comment by Tech blog
2008-05-15 23:38:21

I said j/k.. ;)

(Comments wont nest below this level)

 
 
 
Comment by Khyle
2008-05-15 21:29:51

Great, i’ll add this on my wordpress blog. Hopefully my traffic an income would somehow increase. Hahaha


Comment by Syed Balkhi
2008-05-15 22:19:18

You just gotta have the vision for success :P


Comment by Enkay Blog
2008-06-17 21:13:36

Linking to other pages always gets traffic boost also Syed, excellent detail on these posts. Its obvious you spend a lot of time writing your posts.

(Comments wont nest below this level)

 
 
 
Comment by Enkay Blog
2008-06-17 21:12:47

Thanks for the post. I actually tried that but had some issues but maybe ill give it a shot again. I will be doing my popular posts in a top sidebar item with my next blog design for sure.


 
2009-06-19 02:55:56

[...] Balkhis: How to display Popular Post in your wordpress sidebar [...]


 
Comment by Sushi
2009-11-03 07:41:50

Thanks for this article. It works easily.


 

Sorry, the comment form is closed at this time.

Subscribe to Balkhis via RSS
Subscribe to Balkhis via Email Pimp My Blog