- This topic has 10 replies, 2 voices, and was last updated 5 years, 11 months ago by .
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
- You must be logged in to reply to this topic.
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 π
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 π
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 π
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 π
You’re welcome – have fun lol
GeneratePress
Β© 2024 EDGE22 Studios LTD.