Is there a way to limit the amount of months shown in the Archive widget? I don't want to use a drop-down list (I can manually add a drop down in my footer so people can get the full archive). I'm currently showing 19 months in my Archive list, and want to limit it to 7. I know you can do this manually, but that would mess up my theme, so I wanted to do this with the Archive widget.


I would use the PHP Code Widget from Otto and then simply put this in the widget to limit the archives to 7 months:

<ul><?php wp_get_archives('type=monthly&limit=7'); ?></ul>

(Give the widget a title like Archives if you want, and remove the default WordPress Archive widget.)

Function Reference/wp get archives

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.