Hello Sir, I have used your code found in a discussion:
add_filter( 'post_thumbnail_html', 'tu_post_thumbnail_fallback', 20, 5 );
function tu_post_thumbnail_fallback( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
if ( empty( $html ) ) {
echo '<img src="URL TO YOUR FALLBACK IMAGE" alt="" />';
}
return $html;
}
The above code works and shows the image in archives but not shown in a single post.
Please kindly tell me what is wrong.
Thank you for your good work.