Sequential Logic

The nuts and bolts behind a New Media Startup

Emile Bourquin is the CTO of TNC New Media

The latest Trader Interview

Links

  • New Media Expo 2008

 

May 2006
M T W T F S S
    Jun »
1234567
891011121314
15161718192021
22232425262728
293031  

No border around images in Wordpress sidebar

May 16th, 2006 by User Imageemile

Update: In WordPress 2.1.x, the code below is now in the file wp-includes/bookmark-template.php

I wanted to put an image in the sidebar of this blog, but the default code puts a border around the image, because it’s also a link. I think that’s generally unattractive, but even the link editor didn’t allow me to set the border to 0, so into the code we go.

In wp-includes/links.php, lines 247-249, change this:

$output .= "<img src=\"$row->link_image\" $alt $title />";
else // If it's a relative path
$output .= "<img src=\"" . get_settings('siteurl') . "$row->link_image\" $alt $title />";

to this:

$output .= "<img src=\"$row->link_image\" $alt $title border=\"0\" />";
else // If it's a relative path
$output .= "<img src=\"" . get_settings('siteurl') . "$row->link_image\" $alt $title border=\"0\" />";

and now the images under the Links sidebar won’t have a border around them. Yes, I understand the border is supposed to be a visual cue that the image is also a link, but these days, most people know that things in the sidebar are generally links, plus the visual cue of the pointer changing when a user hovers over the image seems to be enough.

Rate this:
2.5

Posted in Technology |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.