How to register a global hotkey for your application in C#

How to register a global hotkey for your application in C#

Register a hotkey for your application that can be triggered even if your form is minimized and does not have focus. More »

Visual Studio 2013

Visual Studio 2013

Visual Studio 2013 is now available. Make sure to upgrade to the latest version of Visual Studio. More »

How to download a file in C# (progressbar and download speed)

How to download a file in C# (progressbar and download speed)

Learn how to download files in C# while displaying the percentage and the download speed. More »

UDP hole punching implementation in C#

UDP hole punching implementation in C#

Learn how to implement UDP hole punching so you can make your clients life a lot easier by not forcing them to open ports on their end. More »

 

Limit the number of months displayed by WordPress archives widget

Locate and edit your themes functions.php file. This can either be done in the admin panel by navigating to

Appearance -> Editor -> Click on functions.php file

or by directly editing the file which you can usually find under

wp-content/themes/<theme name>/functions.php

After opening the file simply add the following lines in it.

Replace the number 10 with the number of months that you want to display and you are done!

Share on FacebookTweet about this on TwitterShare on Google+Share on StumbleUponShare on LinkedInShare on RedditPin on PinterestShare on TumblrDigg thisPrint this pageEmail this to someone

10 Responses to Limit the number of months displayed by WordPress archives widget

  1. Thanks it works for me too.

  2. Worked perfectly…!!!

    Thanks for sharing.

  3. Scott says:

    Another way to do it is directly on sidebar.php if you want it there.

    wp_get_archives(‘type=monthly&limit=36’);

  4. Caleb says:

    I had my doubts about this solution working but to my surprise, it worked great!

    THANKS!

  5. Nicole says:

    This worked great for my Archive. Is there a way I can use this to limit another widget such as the Categories or another widget list of categories?

  6. Shoshana says:

    This website was… how do I say it? Relevant!! Finally I’ve found something which helped me. Kudos!

  7. Dorothy says:

    Thank you for sharing your info. I really appreciate your efforts and I am waiting for your further post thank you
    once again.

  8. wowby says:

    It’s a shame you don’t have a donate button! I’d without a doubt donate to this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates.

Leave a Reply

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