Home › Forums › Support › Triggering a GP Hook conditionally This topic has 3 replies, 3 voices, and was last updated 4 years, 9 months ago by Ying. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts June 11, 2021 at 7:40 am #1818637 Sal C Hi, I wanted to ask if it’s possible for GP to load a specific JS script on a page only if the referrer URL contains a specific query string parameter. I look forward to your reply. Best regards June 11, 2021 at 9:31 am #1818948 DavidStaff Customer Support Hi there, If you’re hook has no Display Rules you can use this filter to set it to display: https://docs.generatepress.com/article/generate_hook_element_display/ Here’s a similar example where the condition checks for a certain string in the URL to set the display condition: https://generatepress.com/forums/topic/feature-request-6/#post-1385716 June 11, 2021 at 10:14 am #1819002 Sal C Hi David, Thank you for your help. Could you just clarify where that php code should be pasted? Best regards June 11, 2021 at 11:14 am #1819054 YingStaff Customer Support Hi there, In can use one of the method introduced here to add PHP: Adding PHP: https://docs.generatepress.com/article/adding-php/ 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