Created
October 13, 2016 09:04
-
-
Save joshuacharleslake/1c950ce29e2dc65a0657feb50b8884e0 to your computer and use it in GitHub Desktop.
Remove featured image post type support for certain wordpress pages.
This file contains 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
//Remove Featured Image From Certain Pages | |
function remove_featured_image_init() { | |
if ( is_admin() ) { | |
$post_id = 0; | |
if(isset($_GET['post'])) $post_id = $_GET['post']; | |
$posts_without_featured_image = array(2, 106, 109, 125, 130, 141, 145, 149, 153, 172, 176, 207, 219, 226, 239, 241); | |
if ( in_array($post_id, $posts_without_featured_image)) { | |
remove_post_type_support('page', 'thumbnail'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment