Site logo

Archived topic

Conditional for GP Hooks

3 replies · Started by Jam on June 1, 2017

Viewing posts 1–4 of 4

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

Great! Thanks for the quick reply, Leo!

Glad I could help :)

This archived topic is closed to new replies.