Skip to content

Instantly share code, notes, and snippets.

@Pross
Created April 4, 2014 22:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Pross/9984549 to your computer and use it in GitHub Desktop.
Save Pross/9984549 to your computer and use it in GitHub Desktop.
Remove thumbnail from single posts
<?php
function remove_post_thumbnail($metadata, $object_id, $meta_key, $single){
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() )
return false;
else
return $metadata;
}
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4);
@mikezielonka
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment