Created
April 19, 2019 03:16
-
-
Save blogjunkie/f250b7cb576a56b2be259a9be8a83f68 to your computer and use it in GitHub Desktop.
Disabled featured image on certain post types for Astra theme
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
<?php | |
add_action( 'wp', 'child_disable_astra_featured_image' ); | |
/** | |
* Disable Featured image on certain post types. | |
*/ | |
function child_disable_astra_featured_image() { | |
$post_types = array( 'page', 'tribe_events' ); | |
// return early if the current post type if not the one we want to customize. | |
if ( ! in_array( get_post_type(), $post_types ) ) { | |
return; | |
} | |
// Disable featured image. | |
add_filter( 'astra_featured_image_enabled', '__return_false' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment