Drop(down) the Monthly Archives.
88Arguably, the most important feature in your blog’s design is its usability. Can the reader get what they want? A large part of that is giving them the space to manoeuvre unhindered by clutter and superfluous gadgets.
In order to keep your blog clutter-free, you must be ruthless with your sidebar content. There are thousands of WordPress plugins available, and it is very tempting to install them all. The wise blogger knows to add only the options which will be beneficial to the user, which begs the question;
How are the monthly archive links useful?
In most cases, they aren’t. The monthly archives are a remnant from when blogs were literally online diaries. When the posts are a biography of someone’s life, then it can indeed be very interesting to look back to what they were like in the past. The monthly archives were also a lot less hassle than properly categorising posts.
However, blogs are much more than that nowadays. The information is no longer just personal, it is extremely useful! How could a reader find your best posts by picking a meaningless month name? They couldn’t, and that is why a monthly archives list is usually just an unnecessary source of clutter in your sidebar.
To delete the archives from your sidebar, open sidebar.php, and delete the following line: (NB – There may also be text between the brackets.)
<?php wp_get_archives(); ?>
How To Show The Monthly Archives in a Drop Down in WordPress
The biggest problem with monthly archives is that the size of the list grows every single month, taking up more and more room. There is however, a way of getting around this; use a drop-down list. The drop-down takes up very little space until clicked on, and is a suitable method of browsing through the months because they are all in order, making a particular date easy to find.
The code to add this drop-down has actually been put into the WordPress Codex already, but I’ll paste it below anyway.
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Select Month')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select>
And there you have it, a much more compact method of showing the archives. You can see this method being used well on Mike Goad’s Exit 78, where Mike has actually used the same technique on his long category list as well.
If you’re currently showing a long list of months on your blog, then the best advice is to either drop, or drop down that list. You’ll notice the different immediately.
Enjoy this post? You should follow me on Twitter!
Good points here. It drives me crazy when I go to a blog that is cluttered with useless crap and riddled with ads.
Thanks for the tips. I really like your blog design btw. Good job.
jwiowg
Matthew – Couldn’t agree more.
Michael – Back at ya!
Nice tips. I have erase archives in my sidebar and make it into my page file using smart archives plugin. Stuffing sidebar will many things tend to pull reader’s attention out of the original content and some will not read it thoroughly! :(
Thanks for bringing this up. I never thought about it before and now that I am thinking about it, what you said makes sense. I might very well implement your ideas.
Ken Xu – I see what you’ve done there, and I like it a lot! You have the same advantages of showing things chronologically (Including showing how long your blog has been around for), but because the article names are also shown, it’s actually useful. Great implementation!
pablopabla – It would be worth experimenting with probably. If you miss the archives after a week, then you can always put them back in. :) (If you like the archives because it shows that you’ve been blogging for months now, I can understand that. But your blog already shows that it is active by listing the comment counts next to the category names, and the most recent comments.)
Thanks for the tips. I used a similar hack for Blogger, when i was on it. Now, I have archives, but going by the looks of it, I’ll probably take it off completely!
I do think it would be worthwhile. For one thing, with the space you’re freeing up, you could add in a different widget if you liked?
Perhaps a blogroll? Latest comments? Posts?
There are quite a few things that your readers might find more useful. :)
Great article. Thanks for the information. I already moved my archives further down the page and added a Favorite Post list near the top to direct people to the most read articles.
Good idea Patricia. A Favorite Post list is an extremely useful addition to your blog; especially for first time visitors, because they can get straight to your best articles. :)
I’ll go do that now!
Hi Mommy Zabs. I can see you’ve done it on your blog now. Glad this tip was of some use to you. :D
Your sidebar looks neater than what I imagine it was before hand (Your blog has been online for quite a while. Congrats! :D ). I think it also draws more attention to your category list above, because people aren’t distracted by the months. :)
Just what I’ve been looking for and was getting resigned to not being able to find a solution so easy to implement. With a blog that’s been going since 2004 the list of archives was a real pain. I’ve dropped them completely from the sidebar and have the dropdown in the footer. Now about to tackle the categories (which are much too numerous but culling them is a job for another day). Many thanks.
Hi Des Walsh,
The dropdown looks good in your footer. It seems to fit in very neatly. Good idea. :)
As for the categories, this post involves a different drop-down technique that might help you with them. Perhaps that would work?
Thanks, I was looking for something just like this ;D
Welcome. :)
Thanks for the tip Michael. But I have a problem, the menu I want to place the dropdown archive in is of a shorter width than what’s being displayed. I think two things need to be adjusted in the code for it to fit and I was wondering if you know what the correct code bits are and where to put them in the code you show above?
1. The maximum width size for the dropdown menu can only be 100 pixels.
2. The font size should probably be half of what it is on standard, so the month names won’t stretch the dropdown menu.
It’s either one or the other, or both, any help you can give would be much appreciated!
Supa,
Do you know CSS? You can use that to style how the drop-down looks.
e.g. Change the “
<select name="archive-dropdown"
part to:
<select style="width:100px;font-size:11px;" name="archive-dropdown"
Thanks for the codes. It works fine on my site. :)
Hi Michael, thanks so much for that, it worked perfectly! Although I didn’t have to add it to the style.css but instead I could add it to the .php page with the dropdown archive code you provided. Thanks again! :D
jgitjzar
Hey! You might have problems if you add style code into your html when you submit your site for validation…
a solutions for this is to add a class to dropdown code in your html. ex:
<select name="archive-dropdown" class="archivemenu" …rest of the code
then you go to your css and add this:
.archivemenu {
width: 80%;
background-color:#66CCCC;
margin:0 auto;
}
=) works very well.
kisses
is there a way to show both months and years (depending on the year) in the drop down?
say i wanna only show months for 2008 and just year links for years 2007/2006…
is that possible?
thanks!
i have just one question… how do we replace this arrow down button for another image?
I have a question …
How do I make the archive dropdown list to work without Javascript?
are you have some tips on WPMU about last update from another wpmu blog?
Thanks
How can this be made to work with pages?
i’m trying to play with the WP function -> wp_dropdown_pages
I can get it to show up in the theme but when a page is clicked on the page doesn’t load
I love to have the dropdown over all the list of archives, I’m just wondering if there’s a way to get it to validate. When I check my site with this code, I get:
Line 272, Column 41: there is no attribute “onChange” .
…ect name=”archive-dropdown” onChange=’document.location.href=this.options[thi
Can you tell me how I could change that?
Please and thank you :)
same question how to make this passed the validation? thanks:)
in addition make the capital letter “C” on the “onChange=” to small “c” to make it XHTML validated;)
thanks for this share… i’d been looking for archives with listbox…
Thanks! I just collapsed about 3 inches of sidebar clutter (5 years back archives) to one line. Sweeeet!
Alan,
Wow, that’s quite a change! Definitely sounds like it was worth doing on your site! :D
Thanks for the code. thank you very much
Found this link along with the link to the wordpress codex at the same time, I knew there was a way to do it but couldn’t remember how! (of course after i put the code in my sidebar I realized I widgetized my theme so I could have done it all along from within the admin panel)…oh well at least now I know what to do and where to do it at in the future!
nice!!! straight to the point tutorial, got the drop down less than a minute;)
this tag thas I’ve been seaching. really helpful, and thanks a lot :)
Thanks a million! This is exactly what I was looking for :)
Thanks very much! You are made of awesome.
I had been looking for a plugin to do this for me, and here it is in easy to use cut and paste code! Awesome! Thanks. Implemented within about two seconds on both of my blogs.
Nick – Freelance Graphic and Web Designer’s Latest Post: The Hahn Super Dry Ringtone
Dude… Worked great on a friend’s blog…. cut and paste done.
Many thanks.
Tank’s Latest Post: 1 year Popular Science and PM for 5 bucks (think Father’s Day)
Hello
Thank you very much for ranking in Google for how to do this and also thanks for the code.
Ciao!
That’s a great tutorial. Thanks. But there was a problem for me. I tried the same thing for me but, the drop down list box didn’t work. I am using the theme Studio Blue and I want the archives to be displayed in list box manner. When I applied the instruction given here, it only displayed as text! Any help would be appreciated.
Great work for me Michael…no clutter much neater..good artical….I had no problem in down loading..Thanks..
I have to say there is nothing worse than that of a blog that has endless amounts of posts from way back, the less cluttered the site is the better, so thanks for this useful information, its going to be of great use.
Thanks for yours tips. I thought about solution like this. Thanks, it’s really useful.
Thanks its working
now only category. its need to be a drop drown too.
Now Search the tutorial for Catergory :D
Thanks
Best Regrat’s
Darnals
I love reading blogs and sometimes I do go to the archives, but for me to have to see this list of archives on the website it really does irritate me I would so prefer a drop down then to have it take up space on the home page. Thanks for the great tips.
Hi Michael,
I have a problem with the drop down, and I think you can help me. I make a natcasesort() on my drop list and he really works, less with one name “Ícaro”, because of the ‘icute’, how can I fix that? I really tried everything, even the “str_ireplace”.
Thanks for the attention.
Great blog by the way.
Really valuable tips
Thanks
Thank you for the tips. It help me with a customer site and the sidebars
Thank you so much for this awesome tip, Michael! I just love the new look!
By the way, can you please teach me how to include the same for the post pages as it’s only appearing on my homepage? Thanks and God bless you for your generosity in sharing your knowledge.
Thanks for this! Works great! But I am wondering, I want to display the categories in a dropdown list as well, but I want to have so I can adjust the width of the select box. I am having no luck. Is there a way to do so?
Thanks!
I’m a dummy. Where an I suppose to paste the archive code, custom.css?
How do you amend this script to allow you to add a button which once clicked goes to the Archive rather than OnChange?
I have tried a number of different methods but nothing seems to work!
I would appreciate any guidance!
With this, you will certainly be able to share all your archives as long as you want. Viewers will be interested in using this because of the tips that were given.
et what they want? A large part of that is giving the
em the space to manoeuvre unhindered by clutter and s
Nice article, really thanks for it. Just cut and paste and is online.
thank you for share… thank you very very much
thank you for share
thank you very very much
thanks
thank you very very much
thanks
thank you very very much
thanks
thanks
thank you for share
thanks
thanks
thank you for share
thanks
thanks
thanks
Nice article
thanks
Nice article
thanks
thanks
really thanks for it
thanks
really thanks for it
thanks
thanks
thank you very very much
really thanks for it
Nice article
really thanks for it
thanks
thanks
Nice article
Nice article
really thanks for it
thanks
thanks
thanks
thanks
thanks
thanks
I would appreciate any guidance!
I would appreciate any guidance!
thanks
Need help!, I can get it to show up in the theme but when a page is clicked on the page doesn’t load. Also I’ve dropped them completely from the sidebar and have the dropdown in the footer.
Finally I got a really nice or we can say useful post. I would appreciate any guidance!
Great post, I was able to use this one. Thanks for sharing.
When the posts are a biography of someone’s life, then it can indeed be very interesting to look back to what they were like tenant Screening in the past. The monthly archives were also a lot less hassle than properly categorising posts.
I do think it would be worthwhile. For one thing, with tenant Screening the space you’re freeing up, you could add in a different widget if you liked?
I got a really nice or we can say useful post. I tenant Screening would appreciate any guidance!
Hi Michael,
Could you share the code for your blogroll widget?
I’d like to have something similar for categories and archives under each posts (1 col theme)
Thanks in advance
Tomas
Really valuable tips
Thanks
Hi.
Big thanks for the code. Works a treat. ;)
Hello We have discovered your blog post to be extraordinarily helpful.
Woh Everyone loves you , bookmarked ! My partner and i take issue in your last point.
thank for dropping this story. I am definitely tired of struggling to find relevant and intelligent commentary on this subject. Everyone nowadays seem to go to extremes to either drive home their viewpoint or suggest that everybody else in the globe is wrong. thank for your concise and relevant insight.
I
download hollywood movies free
I really like it when I read an article that proves there are writers out there that can get their point across without confusing the topic. This is excellent work.