Ran into an issue to-day in that I have the hooks display working well but now the layout display is failing to stop featured images and titles from showing. I have a layout display set for all pages and ticked the title/featured img in the disable elements but if I create a new page they both show.
Thought disabling the two elements in the page view as well but that didn’t work either. Here’s the code I am using to display the hook displays in my functions.php
//GPRESS --------
// Element_id is the element created in display rules
add_filter( 'generate_hook_element_display', function( $display, $element_id ) {
if ( 60189 === $element_id ) {
if ( is_page_template( 'my-templates/about.php' ) ) {
$display = true;
}
}
// Operational Efficiency
if ( 59978 === $element_id ) {
if ( is_page_template( 'my-templates/operational.php' ) ) {
$display = true;
}
}
// Brand Awareness
if ( 60023 === $element_id ) {
if ( is_page_template( 'my-templates/brand.php' ) ) {
$display = true;
}
}
// Exit Strategy
if ( 60031 === $element_id ) {
if ( is_page_template( 'my-templates/exit.php' ) ) {
$display = true;
}
}
// Services Pages
if ( 60340 === $element_id ) {
if ( is_page_template( 'my-templates/services.php' ) ) {
$display = true;
}
}
return $display;
}, 10, 2 );
I have the hooks setup in the wordpress admin but not set them to display on anything. Could this be the reason the layout display is failing?