Are you looking for an easy way to show blogrolls links as a dropdown in WordPress? By default, WordPress displays the blogrolls in the sidebar as a plain text links list, if you have a lot of links, your sidebar will look very crowded and ugly. In this post, I would show you how to make a easy to use dropdown for your blogroll. This is a option menu, so, no matter how many links there are, it looks concise.
Drop the code below into your functions.php file and save:
function dropdown_links(){
global $wpdb;
$sql = "SELECT link_url, link_name, link_description FROM $wpdb->links WHERE link_visible = 'Y' Order By link_name";
$results = $wpdb->get_results($sql);
if (!$results) {
return; }
$output ='<form action="" name="dd">
<select name="dd2" onchange="document.location=dd.dd2.options[selectedIndex].value" >
<option value="">Select link </option>';
foreach ($results as $row) {
$the_link = '#';
if (!empty($row->link_url)){
$the_link = wp_specialchars($row->link_url);
}
$desc = wp_specialchars($row->link_description, ENT_QUOTES);
$name = wp_specialchars($row->link_name, ENT_QUOTES);
$title = $desc;
if ('' != $title) {
$title = ' title="' . $title . '"';
}
$alt = ' alt="' . $name . '"';
$output .= '<option value="'. $the_link .'">'.$name.'</option>';
}
$output .= '</select></form>';
echo $output;
}

After doing so, insert the line below wherever you want to display blogrolls, for instance, sidebar template(sidebar.php):
<?php dropdown_links(); ?>
You are done!
will this code work in twenty ten theme? where will i insert code into what section of functions.php?
Hate to say, but line 12 of your code came up with a syntax error. No idea why. Just using the basic Twenty Eleven theme and adding it to the end of functions.php