Archived topic
Disable GP Hooks on Homepage
3 replies · Started by Fernando on August 1, 2017
Hello Tom
I'm using GP hooks After Entry Title to add a google adsense After title of all post I want to disable this in Homepage, Is it correct this code?
<?php if ( ! is_home() ) : ?>
Adsense Code
<?php endif; ?>
How to disable in all Pages (Only display on post)?
Thanks
Hi there,
If you are using a static home page then what you need is is_front_page(). See example here:
https://codex.wordpress.org/Conditional_Tags#The_Blog_Page
To only show in post, you would need the is_single() tag. See more info here: https://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page
Let me know if this answers your question.
Thank you Leo
I use <?php if ( is_single() ) : ?> to only show in post :D
No problem!