Simple WordPress Archive Dropdown List Code
Posted by blogmeister on
June 30, 2010
Back then, my blogs used the WordPress plugin Clean Archives Reloaded to display the archives list in a page. Time and time again, I get to encounter problems which I do not know anything about leaving me mystified as to the cause.
Finally, I have had it! I decided to use WordPress’ conventional code to display the archives list … as a dropdown. Since my archives list is located in a page, placing PHP code in it will do nothing because it will treat the content as pure text.
There is a WordPress plugin called Exec-PHP that executes PHP code found in pages or posts. You only need to place the tag
|
1 2 3 |
<phpcode><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></phpcode> |
Share the post "Simple WordPress Archive Dropdown List Code"










