juandahveed
9/28/2017 - 1:16 PM

Set Default Featured Image if None is set

Set Default Featured Image if None is set

//set a default featured image
function wpse55748_filter_post_thumbnail_html( $html ) {
    // If there is no post thumbnail,
    // Return a default image
    if ( '' == $html ) {
        return '<img src="/wp-content/themes/Active-Theme Child/images/default_blog.jpg" class="image-size-name" />';
    }
    // Else, return the post thumbnail
    return $html;
}
add_filter( 'post_thumbnail_html', 'wpse55748_filter_post_thumbnail_html' );