I’m still new to WordPress so might not be adding this filter correctly. I created a child theme and placed the following in the child theme functions.php file:
<?php
add_filter( 'generate_header_element_display', function( $display, $element_id ) {
if ( 11089 === $element_id ) { // Only target specific Element
if ( ! has_post_thumbnail() ) {
$display = false;
}
}
return $display;
} );
When I do this, all of the site pages are blank. When I remove all content from the child theme functions.php file, the site renders as expected while the child theme is still active. So I think the child theme is set up correctly.
Am I missing a step?