WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. richards1052
    Member
    Posted 9 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
    Member
    Posted 9 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:

    http://i.pbase.com/u26/richards1052/small/44107566.PacificCoastiris3pb.jpg
    http://i.pbase.com/u17/richards1052/small/42246937.Seatacmuraltp.jpg
    http://www.richardsilverstein.com/tikun_olam/barcelona_haggadah.jpg

    This is the link for my WP blog:
    http://box22.bluehost.com/~richard2/tikun_olam/

  3. Kathy_P
    Member
    Posted 9 years ago #

  4. mossinix
    Member
    Posted 8 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
    Member
    Posted 7 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>';

    with


    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
    Member
    Posted 7 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

Tags

No tags yet.