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
archive.php theme file (5.0 KiB, 658 hits)
This code snippet is aimed at WP theme developers and those that know a thing or two about coding,…sorry for everybody else;)