Home › Forums › Support › Targetting GP element to display on child pages of a parent page This topic has 3 replies, 3 voices, and was last updated 3 years, 3 months ago by Ying. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts March 8, 2023 at 10:58 am #2560498 Ben Hi, I have an element (javascript that hooks into wp_head) that I need to only appear on all child pages of a particular parent page. Is there a way to set this display rule for GP elements? Many thanks Ben March 8, 2023 at 11:27 am #2560524 LeoStaff Customer Support Hi Ben, I believe the generate_element_display filter is what you are looking for. Take a look at the second example here: https://docs.generatepress.com/article/generate_element_display/ Let me know if this helps 🙂 March 8, 2023 at 12:40 pm #2560596 Ben thanks Leo, Does that go in functions.php ? March 8, 2023 at 4:20 pm #2560717 YingStaff Customer Support Hi Ben, You can use one of the methods introduced in the below article: https://docs.generatepress.com/article/adding-php/ If you are using a child theme, you can add the PHP code to the child theme’s functions.php file. 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