Support » Themes and Templates » Show favicons AND link description in Blogroll

  • Hey everyone,

    I would like to display an icon (the favicon) for every blog on my blogroll together with the blog name. But somehow both doesn’t seem possible at the same time. The blogroll displays either the name or the icon, never both.

    I am using this function:

    <?php get_links('-1', '<span>', '</span>', 'name', TRUE, 'name', TRUE); ?>

    So I set the parameter “show_images” to TRUE. But no more link names are shown then. When i set “link_description” to TRUE, the images disappear.
    Any suggestions?

    You can find my blog here.
    Thank you for your help!
    Jay

Viewing 12 replies - 1 through 12 (of 12 total)
  • First, you should switch to using wp_list_bookmarks() instead of get_links(), but that’s not really relevant to your question.

    Basically, the links display functions all assume that you want to show images or the name but not both. Short of modifying the core code, there’s no fix for this.

    Now, the *description* should display next to the image, if you turn on show_descriptions. So you might use that to show some text. The description will not be linkified though. This may or may not be what you want.

    Hey Otto, thank you for giving me idea with this function wp_list_bookmarks(). Now I can display the image and the description at the same time. That’s 90% of what i want. There is no link for the description but i can live with that.

    Thank you very much!
    Jay

    Jay,

    I entered your blog and I see you could solve the problem of the link on the name/description on the Links section.

    How did you solve it?

    Guilherme

    I too switch from get_links to wp_list_bookmarks() and when i do, all weblog links disappear. Exact code is < ? php wp_list_bookmarks(); ? >
    What am i missing?

    Hi everyone. I fixed the problem with the help of a friend and posted a workaround here. I hope it will help some of you to fix the problem.

    Greets
    Jay

    Thanks Jay, but I think fiddling with the internals of wordpress doesn’t seem a good idea, because it is hard to mantain and the wordpress upgrade will turn into hell.

    I have wrote a small plugin of my own to do the same as an API modification, instead of messing the wordpress code.

    Pretty similar to your solution in many aspects, but without modifiying the original code.

    The plugin is not user friendly at all yet, because I did it only for my own use, but I intend to release it if I can make it a little more naïve fiendly, so it can be useful to other people.

    wmhartl

    (@wmhartl)

    I’m using the WP-Andreas01 theme, and another unclean hack to fix this without changing anything else is to edit wp-includes/bookmark-template.php at line 125 (for WordPress 2.2).

    Change

    $output .= "<img src=\"$row->link_image\" $alt $title />";
    to

    $output .= "<img src=\"$row->link_image\" $alt $title /> $name";

    to put the name just after picture.

    Alternatively, change it to
    $output .= "$name <img src=\"$row->link_image\" $alt $title />";
    to put the name before the picture.

    This fix assumes you are using full http paths to the images. If you are using relative paths to the images, change line 127 similarly.

    Here’s hoping to a permanent WordPress fix or a plugin.
    – Matt

    Has a plugin been released for this yet?

    There used to be a “show” area where you could choose images, link, description etc. for each link. Why was this eliminated?

    I’m looking to display an icon for a link and have both the icon AND the link display AND be linked.

    Thanks in advance!

    OK – it appears my hack above no longer works in 2.3. I’ve been beating on this for a while, and it is driving me crazy. Did _walk_bookmarks change or get deprecated or something?

    Anyone have any suggestions?

    Thanks in advance!

    Hi, I just created a plugin that displays not only the Favicon and name, but you can configure it to show the description, notes and RSS link as well.

    http://www.z-oc.com/blog/powerblogroll/

    Any feedback is welcome.

    That really looks a “power”-ful plugin 🙂

    @moshu: The code to do it was taken from the template I made some weeks before for my blogroll template so is pretty much equally powerful.

    The only differences are that I had to make it more general to the plugin, because the template was a little bit too specific.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Show favicons AND link description in Blogroll’ is closed to new replies.