Astra: Hide the Featured Image on Pages
Stops the Astra theme from showing the featured image at the top of pages, while it is still used for social sharing and page lists.
Opens WPIDE on
Code
add_filter( 'astra_featured_image_enabled', function ( $enabled ) {
if ( defined( 'ASTRA_THEME_VERSION' ) && is_page() ) {
return false;
}
return $enabled;
} );
Notes
Change is_page() to is_singular( 'post' ) to hide it on blog posts instead.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.