public
Last active

How to define a default post thumbnail....

  • Download Gist
default_thumbnail.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12
function default_thumbnail($html) {
global $_wp_additional_image_sizes;
$isize = $_wp_additional_image_sizes;
$w = $isize['post-thumbnail']['width'];
$h = $isize['post-thumbnail']['height'];
if (empty($html)) {
$html = '<figure class="default-post-thumbnail">';
$html .= '<img src="http://placehold.it/'.$w.'x'.$h.'" alt="" />';
$html .='</figure>';
}
return $html;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.