I am using this filter for custom post type. If there is no featured photo, I want to show something else instead. How can I do this?
add_filter( 'generate_featured_image_output','lh_custom_size' );
function lh_custom_size($output) {
if ( is_archive( 'results_category' ) ) {
return sprintf( // WPCS: XSS ok.
'<div class="post-image">
<a href="%1$s">
%2$s
<span class="results_media_stamp shellbell"></span></a>
</div>',
esc_url( get_permalink() ),
get_the_post_thumbnail(
get_the_ID(),
apply_filters( 'generate_page_header_default_size', '' ),
array('itemprop' => 'image', ))
);
}
return $output;
}