Archived topic
How can i turn off gp-hooks for the homepage?
10 replies · Started by George on May 25, 2018
Hey!
I want to find a way to turn off "After Entry Title" gp-hook (which contains Lightweight Social icons shortcode) for the homepage. Homepage is set to display my latest posts. And because of this i can't find page id for it.
<?php if ( ! is_page( [???, 27] ) ) : ?>
[widget id="lsi_widget-2"]
<?php endif; ?>
??? - where the homepage id should go, but i can't find it.
27 - is my about page
How can i solve this? And is there any other ways to make it work?
Hi George, this thread may help:
https://generatepress.com/forums/topic/after-content-hook-content-only-after-posts/#post-280273
Thanks! Almost there ;)
But what if i want to combine them? I mean, i want to turn off the hook on my homepage AND also on my about page.
You can try:
<?php if ( ! is_home() && ! is_page( 27 ) ) : ?>
Content here
<?php endif; ?>
Thanks, David! You rock :D
You're welcome George, glad you got it fixed
Hey, i know this is a bit off-topic (and late), but i wanted to ask where i can learn more about these tags? Like is_home and is_page. I'm not particularly tech savvy, so i would appreciate something for total newbs :D
Also, is there a tag for search page results? Like is_search or something?
<?php if ( ! is_home() && ! is_page( 27 ) && ! is_search() ) : ?>
<?php endif; ?>
Ok, this seems to work fine :D
Hi George, you can learn more of the WP conditional tags here:
Thanks, David!
I think it's time for me to learn some php :D
You're welcome - have fun lol