Viewing 13 replies - 1 through 13 (of 13 total)
  • <select name=”archive-menu” onChange=”document.location.href=this.options[this.selectedIndex].value;”>
    <option value=””>Select month</option>
    <?php wp_get_archives(‘type=monthly&format=option’); ?>
    </select>

    Thread Starter ciryaquen

    (@ciryaquen)

    Thank you, Martin!! That works perfectly.

    Thanks – this was just what I needed too.

    If you don’t want to actually alter your theme files you could add my AWSOM Drop Down Archive plugin which will display a post drop down archive for you after activation.

    How do I set the drop down menu to show annual archive pages instead of monthly ones?

    Also, can the same be done for archives?

    BR,
    – Johanan

    the code that martinhipp posted — exactly which file is it to be copied into?

    Huh? Martinhipp, where does that code go? (Please be specific, I’m not a programmer.)

    Is there something similar to

    wp_get_archives(‘type=monthly&format=option)

    but for Categories?
    I need the “format=option” part, cos wp_dropdown_categories is useless. it will only list the categories, if I select one it won’t go to a new page.

    didn’t want to start a new thread on this…

    but what would you do for posts?

    <select name="archive-menu" onChange="document.location.href=this.options[this.selectedIndex].value;">
    <option value="">Select month</option>
    <?php query_posts('format=option');?>
    </select>

    that unfortunately doesn’t work…tried to replace out the

    wp_get_archives('type=monthly&format=option)

    i’ve also looked at this plugin here

    https://www.dagondesign.com/articles/drop-down-post-list-plugin-for-wordpress/

    but doesn’t seem to work. says it’s good to 2.3 but we’re already at 2.3.1

    any suggestions?

    Follow-up question: I used Martinhipp’s code and it works just fine (WP 2.3.1), but I would like to make the text box a bit wider. Currently, when you drop down the list, the last few characters of some items are truncated.

    Is there some way to make the box wider?

    Is there some way to make the box wider?

    I wasn’t even going to read this thread as it was marked Resolved. Yes you can make it as wide/narrow as you want with a couple of simple mods.

    First, add a class attribute to the above code. Something like class=”dropdown” so that code should now look like…

    <select name="archive-menu" class="dropdown" onChange="document.location.href=this.options[this.selectedIndex].value;">
    <option value="">Select month</option>
    <?php query_posts('format=option');?>
    </select>

    Next add the styling info for that class to your style sheet. Something like…

    .dropdown {
    font-family: arial;
    font-size: 9px;
    color: #000000;
    width:150px;
    background-color: #FFFFFF;
    }

    Adjust the values the way you like.

    Thanks!

    Could this be done also for making a dropdown of bookmarks categories and displaying according to the user’s choice??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to make dropdown list of archives by date and/or categories?’ is closed to new replies.