- This topic has 19 replies, 3 voices, and was last updated 6 years, 9 months ago by
Tom.
-
AuthorPosts
-
June 21, 2019 at 1:47 am #936660
Jonathan
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?
June 21, 2019 at 1:53 am #936663Jonathan
Just tried setting the hooks to a dummy page // editing out the code from the functions.php and the featured img/title are still showing.
June 21, 2019 at 8:41 am #937148Tom
Lead DeveloperLead DeveloperHi there,
So you have a Layout Element created and it’s set to disable those elements, but it’s not working?
Do you have any other Layout Elements that would apply to the same pages? Can you try disabling the other ones to see if there’s a conflict somewhere?
Let me know 🙂
June 24, 2019 at 3:02 am #939271Jonathan
Hello,
I worked out another template was overriding the layout option. Disabling that caused the layout element to work.
thanks
Jonathan
June 24, 2019 at 8:49 am #939704Tom
Lead DeveloperLead DeveloperAwesome, glad you got it working 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.