Last active
May 18, 2018 07:02
-
-
Save Nikschavan/995e2a4d77aebb094e90651dc961935c to your computer and use it in GitHub Desktop.
Disable featured images on all pages - Astra WordPress 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 // don't copy this line in your code | |
/** | |
* Disable title on all post types. | |
* | |
* Change 'page' post type to your custom post type if you want to use this for different custom post types. | |
*/ | |
function your_prefix__featured_image() { | |
$post_types = array( | |
'post', | |
'page', | |
'testimonials' // Add your post type slug's. | |
); | |
// bail early if the current post type if not the one we want to customize. | |
if ( ! in_array( get_post_type(), $post_types ) ) { | |
return; | |
} | |
// Disable Post featured image. | |
add_filter( 'astra_featured_image_enabled', '__return_false' ); | |
} | |
add_action( 'wp', 'your_prefix_featured_image' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment