Publishing monthly roundup is not only a great way to add some extra value to your blog SEO but also it helps to rewind the old articles for your readers. But publishing your roundup posts manually is tedious one. So here I’ve found out a simple way to ease your effort. Don’t worry! You need not to be an expert. Lets go.
We’ll use a shortcode to fetch post title and permalinks from the previous month. Whenever you will paste that shortcode in your post, it will display all the post titles with their permalink.
How to create the shortcode for monthly round up
Add the following code in your theme’s function.php
The above is the screen shot of the codes. Click to Download the code (text file).
Add the following code to your CSS file
Voila! You are done. Now go to WordPress admin > Add new post or page, Give a suitable title for it and paste the following shortcode in the edit box.
Now publish your post or page. It will automatically print all the posts from the previous month. I also use this tricks for this site. You can see that here.
How does it Work?
Here we are creating a shortcode for WordPress which will execute the queries in any page or post. Here we have used the query_post() function to filter the posts from previous month. Learn more about query_post() function. So when the shortcode will be executed it will calculate the current month and year then pickup all the posts from the previous month. Using this method you can also publish weekly roundup for your blog.
I use this automatic procedure. Which method do you use for your blog: manual or automatic? Le me know.