• Can you help me with the code for this?

    On my blog, I have 3 categories of links: Pictures, RSS Feed, and Videos. Right now, in the sidebar, I list all of these using wp_list_bookmarks(‘orderby=id’). What I would like to do is put the Pictures in a drop-down menu to select, and then list the RSS Feed and Videos just like I am now…

    Can anyone help me out?

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • There is no way (that I know of) to create a dropdown menu using wp_list_bookmarks.

    Thread Starter grallaj

    (@grallaj)

    Could it work somehow with get_bookmarks? I tried, but to no avail…

    Thread Starter grallaj

    (@grallaj)

    None of those were working for me… Maybe I just don’t know enough code…

    In my sidebar – the following code works for my drop-down archive:

    <li><h2>Archives</h2>
    				<ul>
    <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>
    				</ul>
    			</li>

    So – I am a little confused as to why the following doesn’t work for a Pictures drop-down box a little below that in the sidebar:

    <li><h2>Pictures</h2>
    				<ul>
    <select name=\"picture-dropdown\" onChange='document.location.href=this.options[this.selectedIndex].value;'>
      <option value=\"\"><?php echo attribute_escape(__('Select Pictures')); ?></option>
      <?php get_bookmarks('category_name=Pictures'); ?> </select>
    				</ul>
    			</li>

    Thread Starter grallaj

    (@grallaj)

    Any thoughts?

    Thread Starter grallaj

    (@grallaj)

    I guess it can’t be done…

    are you talking about putting pictures in the main nav bar?

    Thread Starter grallaj

    (@grallaj)

    A drop-down menu of my picture links in the sidebar…

    Thread Starter grallaj

    (@grallaj)

    bump for anyone who might have an idea…

    <?php
    $test = wp_list_bookmarks('echo=0&title_li=&categorize=0');
    $test = str_replace('<li','<option',$test);
    $test = str_replace('/li>','/option>',$test);
    echo $test;
    ?>

    Would work…. however i’ve found that WordPress is removing any option tags i plonk in the template file..

    You can verify that wordpress does this by replacing “option” in the above code to anything else.. “opt10n” for example would work, but is no good since it’s totally invalid code.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to add drop-down menu for links?’ is closed to new replies.