Skip to content

Show Popular Posts on WordPress like Tim Ferriss

Tim's blog uses DOMTab for tabbing the top lists of popular posts.

Tabs are populated with WordPress Popular Posts plugin and some manual lists as well.

Remember to allow shortcodes in sidebar.

Then add a text widget with something like:

<div class="domtab">

<ul class="domtabs">

<li class="active"><a class="domtab1" href="#t1" style="cursor:pointer;">Current hits</a></li>

<li><a class="domtab2" href="#t2" style="cursor:pointer;">All time</a></li>

<li><a class="domtab3" href="#t3" style="cursor:pointer;">My favs</a></li>

</ul>

<div class="domcontent domcontent1">

<a name="t1" id="t1"></a>[wpp range=weekly order_by=views limit=5 stats_comments=0 wpp_start="<ul class='domlist'>"]

</div><!-- ends domcontent1 -->

<div class="domcontent domcontent2">

<a name="t2" id="t2"></a>[wpp range=all order_by=views limit=5 stats_comments=0 wpp_start="<ul class='domlist'>"]

</div><!-- ends domcontent2 -->

<div class="domcontent domcontent2">

<a name="t3" id="t3"></a><ul class="domlist">

<li><a href="">a</a></li>

<li><a href="">b</a></li>

<li><a href="">c</a></li>

<li><a href="">d</a></li>

<li><a href="">e</a></li>

</ul>

</div><!-- ends domcontent3 -->

</div><!-- ends domtab -->

Styling needs some work, but the end results works great.

However, if you want to insert historical data (all time data is zero to begin with), you need to edit the MySQL database by hand. Not a biggie for those accustomed to it (MyPHPadmin, for instance, provides a nice interface for that).

2 Comments

  1. This is exactly what I was looking for! How hard would it be to add thumbnail images beside the headlines?

    Posted on 26-Apr-12 at 7:02 am | Permalink
  2. Jussi wrote:

    I'm glad this was useful! Haven't tried to utilize thumbnails but it seems to be built-in in the plugin. If you encounter problems, plugin FAQ says:

    "I'm unable to activate the "Display post thumbnail" option. Why? Make sure that: your host is running PHP 4.3 or higher; the GD library is installed and enabled by your host; your theme has been enabled to use the Featured Images functionality."
    http://wordpress.org/extend/plugins/wordpress-popular-posts/faq/

    Posted on 26-Apr-12 at 2:11 pm | Permalink