Skip to content

Instantly share code, notes, and snippets.

@blogjunkie
Created April 19, 2019 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blogjunkie/f250b7cb576a56b2be259a9be8a83f68 to your computer and use it in GitHub Desktop.
Save blogjunkie/f250b7cb576a56b2be259a9be8a83f68 to your computer and use it in GitHub Desktop.
Disabled featured image on certain post types for Astra theme
<?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