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 »

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

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

  1. Sierra Square says:

    There should be a default option. Thank you for the Code. Works perfectly.

  2. Manuel Manceli says:

    Thanks it works for me too.

  3. Mark Kovach says:

    Worked perfectly…!!!

    Thanks for sharing.

  4. Scott says:

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

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

  5. Caleb says:

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

    THANKS!

  6. 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?

  7. Shoshana says:

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

  8. 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.

  9. 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 *