Ajay's Creations Support Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ajax Edit Comments is now subscription based. All support questions need to be directed to http://www.ajaxeditcomments.com/forums/

Pages: [1]   Go Down

Author Topic: Contextual Related Posts: Borders around Thumbs temp fix and to do suggestion  (Read 210 times)

Gregg

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
    • Hallee the Homemaker

The Contextual Related Post takes no account of the (default) action of most themes to put a border around the thumbnails.  Depending upon the browser and theme combination, the border around the linked thumbnail can look quite ugly and distracting.  The way to turn off the borders is to add a *border="0"* string into the IMG tag.  Example:

'<img="http://mydomain/image1.png" border="0" width="50" height="50>'

I was able to institute a temporary fix for this by editing two lines of your plugin code.  The code changes follow:

$output .= get_the_post_thumbnail( $search->ID, array($crp_settings[thumb_width],$crp_settings[thumb_height]), array('title' => $title,'alt' => $title,'class' => 'crp_thumb'));

changed to...

$output .= get_the_post_thumbnail( $search->ID, array($crp_settings[thumb_width],$crp_settings[thumb_height]), 'border="0"', array('title' => $title,'alt' => $title,'class' => 'crp_thumb'));

and ...

$output .= '<img src="'.$postimage.'" alt="'.$title.'" title="'.$title.'" width="'.$crp_settings[thumb_width].'" height="'.$crp_settings[thumb_height].'" class="crp_thumb" />';

changed to...

$output .= '<img src="'.$postimage.'" alt="'.$title.'" title="'.$title.'" border="0" width="'.$crp_settings[thumb_width].'" height="'.$crp_settings[thumb_height].'" class="crp_thumb" />';

I am thinking that this would be very easy to turn into a variable which you could then allow the end user to customize in your settings page with a default of "no border" and an option of "highlight thumbnails with link border" if you so pleased.

Really good plugin.  Thanks so much.
Gregg
Logged

Ajay

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 596
    • View Profile
    • Ajay - On the Road called Life

Hi Gregg,

It never struck me about the border. But, this is a good suggestion that I will implement. I'll set the border to 0, as you suggested. (in all my plugins) and then anyway you have the class that can be styled, so need to provide yet another option.
Logged
Pages: [1]   Go Up