WordPress.org

Ready to get started?Download WordPress

Forums

Show blogroll with pull-down menu (20 posts)

  1. nicholaswong
    Member
    Posted 7 years ago #

    I want to show my blogroll with a pull-down menu, and when I choose the site from the list, the browser help me to open a new page to view, how can I do this? Thank you very much!!

  2. dremation
    Member
    Posted 7 years ago #

    try this

    <li class="blogroll"><h2><?php _e('Blogroll:'); ?></h2>
    <form action="" name="pulldown2">
    <select name="mypulldown2" onchange="document.location=pulldown2.mypulldown2.options[selectedIndex].value">
    <option value="">Select Blog</option>
    <?php wp_get_links(); ?>
    </select>
    </form>

  3. nicholaswong
    Member
    Posted 7 years ago #

    Thanks dremation, but it just show the pull down with the word "select blog", and no links can be shown!

  4. dremation
    Member
    Posted 7 years ago #

    umm.....I forgot to close the
    <li> tag...did you forget to? This works for me.

  5. nicholaswong
    Member
    Posted 7 years ago #

    Sorry, dremation, close for what?

    the <li> you mean?

  6. nicholaswong
    Member
    Posted 7 years ago #

    Still can't figure it out, anyone...?

  7. carnold
    Member
    Posted 7 years ago #

    Same here. Have the drop-down but nothing listed in the drop-down. Can anyone help?

  8. Guzzo
    Member
    Posted 7 years ago #

    Try this at the end..

    /li (in brackets)

  9. carnold
    Member
    Posted 7 years ago #

    I tried that and nothing changed. < / li > (no spaces)
    Here is my code:
    <li class="blogroll"><!--<h2><?php _e('Blogroll:'); ?></h2>-->
    <form action="" name="pulldown2">
    <select name="mypulldown2" onchange="document.location=pulldown2.mypulldown2.options[selectedIndex].value">
    <option value="">Select Blog</option>
    <?php wp_get_links(); ?>
    </select>
    </form>

  10. nicholaswong
    Member
    Posted 7 years ago #

    Are there something missing from dremation's code?

    <form action=""> & <option value="">??

  11. anabelle
    Member
    Posted 7 years ago #

    should be something, like this....


    <li class="blogroll"><h2><?php _e('Blogroll:'); ?></h2>
    <form action="" name="pulldown2">
    <select name="mypulldown2" onchange="document.location=pulldown2.mypulldown2.options[selectedIndex].value">
    <option value="">Select Blog</option>
    <?php wp_get_links(); ?>
    </select>
    </form>
    </li>

  12. nicholaswong
    Member
    Posted 7 years ago #

    anabelle, thanks, but still blank for those 2 fields?

  13. anabelle
    Member
    Posted 7 years ago #

    do you get the select blog title in the dropdown??

  14. nicholaswong
    Member
    Posted 7 years ago #

    anabelle:

    It only shows the "select blog" text, but no content when the drop down menu.

    Is the above code in full? Any missing from those 2 fields? Thx!

  15. anabelle
    Member
    Posted 7 years ago #

    Loggin to the admin --> links ---> link categories

    edit the blogroll categorie.. and add in the fields:

    Before link: <option value="
    Between link and description: ">
    After link: </option>

    I don't know if this will work and maybe it wont, but is worth the try, also if it works the text that will appear in the dropdown will be the description of the link, and not the link itself so you maybe will need to update your links descriptions.

    I'm just guessing that code out so please let me know if it worked, that would make me real happy.

    Good Luck

  16. nicholaswong
    Member
    Posted 7 years ago #

    anabelle,

    Unbelievable the drop down menu shows the page title now, but when I click it, nothing happened!

    However, if I change the following code:

    <select name="mypulldown2" onchange="document.location=(document.forms.pulldown2.mypulldown2[document.forms.pulldown2.mypulldown2.selectedIndex].value)">

    After I click the page title it directed to a dead page, which the link location shown: http://xxx/<a%20href=

    So what can I do next?

  17. anabelle
    Member
    Posted 7 years ago #

    i would love to help but i don't know what else to do, but remember that there is always the option to do it manually directly on your template, if you don't have so many links.

    just write:

    <li class="blogroll"><h2>Blogroll:</h2>
    <form action="" name="pulldown2">
    <select name="mypulldown2" onchange="document.location=pulldown2.mypulldown2.options[selectedIndex].value">
    <option value="">Select Blog</option>
    <option value="http://blog1.com">blog1</option>
    </select>
    </form>
    </li>

    and keep adding:
    <option value="http://blog1.com">blog1</option>
    replacing the values for each blog

  18. nicholaswong
    Member
    Posted 7 years ago #

    anabelle, thanks for your help!

    I can surely manually add the links, but I've more than 15 links so that's quite a lot. But now seems nothing I can do else and this maybe the only method I can stick to.

    Thanks anyway!

  19. nicholaswong
    Member
    Posted 7 years ago #

    If I want the links in pull-down shown in new window, how can I do? Modify the following lines??

    Many Thanks.

    <select name="mypulldown2" onchange="document.location=pulldown2.mypulldown2.options[selectedIndex].value">

  20. aryst
    Member
    Posted 7 years ago #

    nicholaswong, I don't know if you are still facing this problem but I think u just need a blogroll widget like me (searching for it)...I found it at http://adrian.web.id/2007/05/01/wordpress-plugins-blogroll-links-widget/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.