WordPress ShortCode: Automatically Publish Monthly RoundUp Post

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

.round ul{line-height:2.5em;list-style:none}

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.

[roundp]

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.

7 Readers posted their valuable comments on the article - WordPress ShortCode: Automatically Publish Monthly RoundUp Post
  1. Shabnam Sultan

    This is really an interesting one :) i am gonna try it sometime.Monthly round ups are tedious process..

  2. Tanmay

    Yes! You must. Things should be automatic..

  3. Imran@TechiesBlog

    Hi Tanmay

    This is wonderful, I have also created a complete roundup till date and it ate all my time. The other day I was also reading on creating roundup using a plugin.

    How every I am going try it my blog to faster my roundups quickly and easily.

    Thanks for the share mate
    IMran

  4. Udegbunam Chukwudi

    I’ll give it a try @ the end of this month and see what happens ;-). In the meantime I’ma try it out on my localhost installation.

    P.S: You’re doing your blog some injustice by not having the subscribe to comments plugin ;-)

  5. Tanmay

    @Chukwudi: Let me know if you like it or not. Thanks for the suggestion. I’ll do it in very recent day.

  6. Patricia@lavenderuses

    Thanks Tanmay you sure know your stuff. I usually get friends to do my techie stuff for me otherwise I wouldn’t get anything else done on my blog lol
    You explain things really well and showing the screenshot makes it so much easier to understand.
    Patricia Perth Australia

  7. Tanmay

    Really your appreciation will inspire me. Do contact me for any type of tech help.

Leave a Reply

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