Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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