No results found. Try again with different words?

Search must be at least 3 characters.

Disable featured image on all pages

Sidebar Image

Did not find a solution? We are here to help you succeed.

Astra has a filter astra_featured_image_enabled which can be used to programmatically enable or disable the featured image.

Here is an example snippet that shows how you can disable the featured image on all the pages by default.

/**
 * Disable featured images for pages.
 * Set the featured image to false if current post type is 'page'
 * 
 * @param  boolean $status True - Enable featured image; False - Disable featured image
 * @return boolean         Featured image status based on the 
 */
function disable_feattured_image_for_posts( $status ) {

	// disable featured image for pages.
	if ( 'page' == get_post_type() ) {
		$status = false;
	}

	return $status;
}

add_filter( 'astra_featured_image_enabled', 'disable_feattured_image_for_posts' );

Note:

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Astra is Free. Now & Forever.

We believe creating beautiful websites should not be expensive. That's why Astra is free for everyone. Get started for free and extend with affordable packages.

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form