Links: cannot display image AND link name (6 posts)

  1. richards1052
    Posted 11 years ago #

    In my new WP blog, I've created link categories & links which contain link name, URL & image url. I notice that whenever you have an image url the link name doesn't seem to display in my sidebar. With books & CD cover images in my links I need the titles to display as well or no one will know what they're looking at.

    I also cannot display external image urls in my sidebar links. Does WP disable this purposely? Can you change a setting to permit it?

    I hope there are ways to change these behaviors.

  2. richards1052
    Posted 11 years ago #

    I've figured out part of my problem. I discovered that you need to use the description field if you have an image & want to display text.

    But I still can't get WP to display these image files in sidebar links:


    This is the link for my WP blog:

  3. Kathy_P
    Posted 11 years ago #

  4. mossinix
    Posted 11 years ago #

    A workaround is to add the images manually in the DB into the structure of the name. That way both the text and the image will be displayed. If the link name is TEXT, you can do <img src="">TEXT. When WP parses the name it will include the image in the link.

  5. bradkovach
    Posted 9 years ago #

    I had the same problem. I've yet to implement the solution into a plugin.

    In wp-includes/links.php (WP 2.0.5) goto line 147, insert a return and type

    $show_title = true,

    then, on line 155 of links.php replace

    $output .= '</a>';


    if($show_title && $show_images) {
    $output .= $name.'</a>';
    } else {
    $output .= '</a>';

    Now, you may use <?php get_links('', '', '', '', true, true); ?>. The first true enables images, and the second will enable the title. The first true must be enabled to enable the second.

    Hope this helps.

  6. TravisSeitler
    Posted 9 years ago #

    I think you meant line 255, not line 155. ;)

    Besides that, it works great! Thanks for the tip.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.