Created
October 5, 2021 02:09
-
-
Save vandanojan/c4ca3e8e799ea2fbe7a3fe093b359191 to your computer and use it in GitHub Desktop.
WordPress: How To Remove Featured Images in Single Posts
This file contains hidden or 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 my_post_image_html( $html, $post_id, $post_image_id ) { | |
if(is_single()) { | |
return ''; | |
} else | |
return $html; | |
} | |
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment