Created
November 18, 2012 02:13
-
-
Save shawnsandy/4102907 to your computer and use it in GitHub Desktop.
How to define a default post thumbnail....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment