WordPress Blogroll Dropdown

Jill Salzman (momtrepreneur) asked me to create a dropdown blogroll for her blog to help cleanup a long list of bookmarks that she likes to share with her readers.

Here is an example of how the Blogroll Pulldown looks on her site.

Of course the first thing I always do is search for an existing WordPress Plugin or Function. While doing this search I came across The Information Gateway blog which has a post about just such a function to add a dropdown blogroll. I tried the code TIG has posted but there was a small problem with it, so I modified the code to get it working.

My revised code is available here, simply add the function to your themes function file, and make the appropriate call as outlined in the code.

 


18 thoughts on “WordPress Blogroll Dropdown

  1. Andi, your welcome. If you have a new link I will be glad to add it. And thanks for doing the script the first time, it was a real time saver and very helpful.

  2. David,
    Thanks a lot for this code, it works perfectly for me, but i have just two quick questions :
    #1 how to make the links open in a new window ?

    #2 how to organize them by category ?

    on my blogroll manager, they are all set by categories and open in new window – would love to know how to make those two options incorporated into the drop down menu

    otherwise thanks a lot for your code =]

  3. Hi David

    I am not a PHP person, but I would like to try to get this to work. I added the code to my functions.php file (I am using WP 2.7.1 and ‘This Just In’ as my template) but I haven’t figured out the most appropriate place to put the call. I’ve tried a few things, but no luck.

    This is exactly what I am looking for, but I know I am missing something in order to use it properly. I am pretty comfortable with HTML, but this is a bit new to me.

  4. Typically items like this are placed in the sidebar. With that said, the first thing you have to establish is whether you are using widgets or not. If you are using widgets this code has to go before or after the call to the widgets in the sidebar. If you are not using widgets, you can place the code in the sidebar code where you want it to appear.

    If that does not help, send me your email address in the contact form on this site and I will try to help you some more.

  5. sweet code.

    I was trying to figure out if I can seperate links by category though. I seperate my blogroll olinks depending on what kind of link it is. Is it possible to only list links in one category, then use the code again to list link in another category?

    I tried adding this in the function code: “cat_id = 2″… example:

    “SELECT link_url, link_name, link_description FROM $wpdb->links WHERE link_visible = ‘Y’ , cat_id = 2 Order By link_name”;

    doesn’t work though. any suggestions?

  6. Danny, the problem is the category taxonomy changed some time ago. The Link Category (cat_id) is now held in the taxonomy files and takes extra work to validate through queries.

    I will try to do this when I get some available time.

  7. This is great! So easy, so quick. Can’t believe the difficulties I had trying to find a plugin or work-around. This solved it so fast!

    My only thought and question: Would it possible to attach target=”_blank”? That way the blog roll links to completely remove the visitor from the site?

  8. Thank you so much for this! It worked perfectly and it’s a huge bonus for it not being another plugin that I have to install! A lot of websites make accomplishing this feat so complicated.

  9. Hi I would like to use this code but is there a way to use it with an specific category, the thing is that I want to put 2 Dropdown Blogroll each for different Blogroll Categories

  10. Sorry, it didnt allow me to put the code, Is there any string as something like this:
    ” php dropdown_links(‘link_cat=34’); “

Leave a Reply

Your email address will not be published. Required fields are marked *