WordPress.org

Forums

dropdown jump menu with categories? (5 posts)

  1. grinneller
    Member
    Posted 5 years ago #

    Hi,

    I've found some code that's working to make a dropdown jump menu for the monthly archives, but can't seem to get it to work for categories. Here's what I'm using:

    <?php
    
    echo "<select name='archive-dropdown3' onChange='document.location.href=this.options[this.selectedIndex].value;'>
    <option value=''>";
    echo attribute_escape(__('Browse by Month'));
    echo "</option>";
    wp_get_archives('type=monthly&format=option&show_post_count=1');
    echo "</select>";
    
    ?>

    I've tried wp_list_categories, and the_category, but can't get either to work with the above code. Any ideas?

    Thanks!

  2. esmi
    Forum Moderator
    Posted 5 years ago #

  3. grinneller
    Member
    Posted 5 years ago #

    Thanks esmi--I tried that, but it just gives me a static dropdown. I'm trying to make it a jump menu.

    Also, how do I give it a title that appears in the bar, like the code above does with "Browse by Month"?

    Thanks!

  4. grinneller
    Member
    Posted 5 years ago #

    bump: Anyone have an idea here? I'd be grateful for any help, thanks!

  5. esmi
    Forum Moderator
    Posted 5 years ago #

    Did you try the 2 JavaScript solutions?

Topic Closed

This topic has been closed to new replies.

About this Topic