Home › Forums › Support › Hook for page and all subpages This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Tom. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts August 27, 2019 at 4:21 am #994422 Michal Hello, is there any way to display the hook on the parent page and all the subpages of this parent page automatically? In display rules section I can choose only concrete pages one by one. August 27, 2019 at 8:35 am #994722 TomLead Developer Lead Developer Hi there, This topic might help: https://generatepress.com/forums/topic/conditionally-display-hook-on-sub-page-of-parent/ For example: add_filter( 'generate_hook_element_display', function( $display, $element_id ) { global $post; if ( 1180 === $element_id && ( is_page() && $post->post_parent == '415' ) ) { $display = true; } return $display; }, 10, 2 ); You need to replace 1180 with the ID of your Element, and 415 with the ID of the parent page. August 27, 2019 at 9:44 am #994788 Michal Great it works perfectly ๐ August 27, 2019 at 4:30 pm #995021 TomLead Developer Lead Developer Awesome ๐ Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In