WordPress really is a remarkable tool but there is no way to show popular posts of current category you are browsing just by using WP template tags. For instance if your blog has category Sport, it would be nice to show of the most popular posts in that category for the last month or so -> automatically of course….Well, I was searching forĀ plugins that would do the trick, code snippets and much more but haven’t found anything similar so I’ve decided to code this myself – directly from database.
And because I really love simplicity this code is also as simple as possible…Here is what you should do:
- Download archive.php file found below
- Open your theme theme file also called archive.php
- Use my code at your own risk=) … just be careful and place it outside loop
[download id=”2″]
This code snippet is aimed at WP theme developers and those that know a thing or two about coding,…sorry for everybody else;)
Bil
14 years ago
how can I implement this code in a widget?