Follow @BPSPro

WordPress Display Popular Posts In The Sidebar Without Using a Plugin – WordPress Text Widget

Comments Off RSS Site Feed Author: AITpro Admin
Published: August 9, 2010
Updated: August 11, 2010

The orginal question was regarding how to display WordPress popular posts in the WordPress sidebar without using any plugins.

Hmm very interesting question. Yes you can always hard code your Popular Posts to display in your sidebar in WordPress (and in your WordPress template file or files instead of the sidebar) instead of using a plugin, but why would you want to for something as simple as this? I’m sure you have a good reason for not wanting to install a WordPress plugin or maybe you can’t install a WordPress plugin for some reason?

You can always use the Text Widget in WordPress to add whatever “raw” code you want to add to your sidebar instead of putting the hard coding into your WordPress Theme’s sidebar.php file.

I googled “how to display Popular Posts in wordpress without using any plugins?” and I found some hard coding examples of stripped down and very simplified Popular Posts code you would add to your sidebar.php file. All the examples I found are actually too simple and do not contain I18n Internationalization appropriate code and other coding functions that should be there so I am not going to add the links here.

It would be better to look at the code from a Popular Posts plugin that has already been created and then create your custom coding directly into your sidebar.php file or add the code to the WordPress Text Widget. The reason I recommend this is a lot of careful thought goes into creating WordPress plugins: International functionality, security, compatibility with all versions and themes, etc etc etc and WordPress plugins have to go through an approval process with the WordPress people before they will allow a plugin to be accessible from their WordPress Directory. 

Anyway in your particular case you are looking for coding that performs a simple task where you probably don’t have to worry about things like a security breach or hacker exploitable code so you should just be thinking more about ease of use down the road. ie if you need to change something how long does it take, etc etc etc.

Skip to toolbar