(+84) 463.28.7979

Display Popular Posts by Day, Week, Month, and All Time in WordPress

A user in our facebook community asked if we could show how to make a page that display popular posts by day, week, month, and all time in WordPress. We have decided to take it a notch higher and decided to add the tabber aspect in it as well. So in this article, we will show you how to add a tabber with popular posts by day, week, month, and all time in your WordPress sidebar without editing a single line of code. We will also show you how to create a separate page that displays popular posts by day, week, month, and all time in your WordPress blog.

How to Add a Tabber with WordPress Popular Posts

Normally, you would have to add bunch of jQuery code, add your own CSS, get down and dirty with the codes in WordPress files only to waste time and build frustration. So in this technique, we will be adding a tabber in our WordPress sidebar that lets you display popular posts by day, week, month, and all-time. To accomplish this, we will be using the plugin called WordPress Popular Posts, andTabber Tabs Widget.

Note: In order for this technique to work, your theme must be Widgets Ready.

Lets go ahead and install/activate these WordPress plugins.

Now head to your Widgets screen that can be found Appearance » Widgets. Here you will see two widgets added (one is called Tabber Tab Widgets and the other is called WordPress Popular Posts).

Tabber Widgets

You will also see a new widget location added in the right called “Tabber Tabs Widget Area”. Drag the WordPress Popular Posts widget in this location. Set the title to Daily, time range to today, select your sorting options, how many posts you want to show, and save the widget. Repeat this process 3 more times, so you can have one tab for each time range (daily, weekly, monthly, all-time). The final view should look like the image below:

Tabber Tabs Widgets Area

Now look in the widget locations, you should see another one called Primary Sidebar or something similar. Drag your Tabber Tabs Widget into this location. Select the style you want, and save this sidebar. If your theme does not have a widget ready sidebar, you should consider asking the theme developer to add it, or switch to a theme that follows WordPress standards like the Standard Theme.

Note: Do not drag Tabber Tabs Widget into Tabber Tabs Widget Area.

Tabber Tabs Widgets

The final outcome of this would look like this:

Tabber Preview

That wasn’t so hard was it? Now you can attract attention to your most popular posts in the sidebar and make them even more popular.

How to Add a Separate Page with Popular Posts

This technique requires you to know the basics of HTML/CSS and a fair understanding of how WordPress themes work. We will use the plugin calledWordPress Popular Posts, and the custom page templates technique to accomplish our goal.

Once you have installed the plugin, go to Settings » WordPress Popular Posts. There is a help section that you want to keep open as you do this because you will be referring to the tables in there.

Use our Custom WordPress Page Template technique, to create a new page template. Add the appropriate styles to match your main blog theme. Then paste the code:

1 <?php get_mostpopular("range=daily&limit=10"); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>