Home › Forums › Support › Conditional for GP Hooks This topic has 3 replies, 2 voices, and was last updated 6 years, 10 months ago by Leo. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts June 1, 2017 at 5:00 am #327119 Jam Hi I have a few hooks that I only want in certain pages. For a hook that’s excluded on the homepage, I use this: <?php if ( ! is_front_page() ) : ?> content <?php endif; ?> My questions are: 1) how should the conditional be if I want this same hook to be excluded in – homepage – categories – pages – archives that is, I only want it on individual posts 2) And what’s the code if I only want it on individual pages and posts? Thanks a lot June 1, 2017 at 8:16 am #327186 LeoStaff Customer Support Hi there, 1) <?php if ( is_single() ) : ?> content <?php endif; ?> 2) <?php if ( is_single() || is_page() ) : ?> content <?php endif; ?> More info here: https://codex.wordpress.org/Conditional_Tags June 3, 2017 at 8:53 am #328080 Jam Great! Thanks for the quick reply, Leo! June 3, 2017 at 9:28 am #328102 LeoStaff Customer Support Glad I could help 🙂 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