WordPress.org

Plugin Directory

Changeset 636771


Ignore:
Timestamp:
12/10/12 21:23:53 (17 months ago)
Author:
mitchoyoshitaka
Message:

default thumbnail fix, for some cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • yet-another-related-posts-plugin/trunk/template-thumbnails.php

    r634494 r636771  
    4040        $output .= "<a class='yarpp-thumbnail' href='" . get_permalink() . "' title='" . the_title_attribute('echo=0') . "'>" . "\n"; 
    4141 
     42        $post_thumbnail_html = ''; 
    4243        if ( has_post_thumbnail() ) { 
    4344            if ( $this->diagnostic_generate_thumbnails() ) 
    4445                $this->ensure_resized_post_thumbnail( get_the_ID(), $size, $dimensions ); 
    45             $output .= get_the_post_thumbnail( null, $size ); 
    46         } else { 
     46            $post_thumbnail_html = get_the_post_thumbnail( null, $size ); 
     47        } 
     48         
     49        if ( trim($post_thumbnail_html) != '' ) 
     50            $output .= $post_thumbnail_html; 
     51        else 
    4752            $output .= '<span class="yarpp-thumbnail-default"><img src="' . esc_url($thumbnails_default) . '"/></span>'; 
    48             // assume default images (header images) are wider than they are tall 
    49         } 
    5053 
    5154        $output .= '<span class="yarpp-thumbnail-title">' . get_the_title() . '</span>'; 
Note: See TracChangeset for help on using the changeset viewer.