- This topic has 3 replies, 2 voices, and was last updated 4 years ago by
Leo.
-
AuthorPosts
-
February 6, 2017 at 6:20 pm #275329
Tom
Hi,
I’d like to have a different site tagline for a few different pages. I’m pretty sure it’s possible… I just don’t know the CSS to make it happen or where exactly to put it.
Here’s my site: http://www.tomcrehan.com. My tagline (as seen on the About page) is “I play with words.” I’d like to slightly alter it for my Film & TV page (“I play with words… and spin stories”), my VO page (“I play with words… out loud”) and my Copywriting page (“I play with words… for fun and profit”).
I’ve already turned off the tagline in the Customizer and typed it into the Appearance/GP Hooks/After Header Content box. But I’m a bit lost as to what to do next. I know just enough tech to be dangerous but am not a coder… though I’ve managed to sift through the forums and find bits of CSS to change the padding on the navigation bar, float social media icons to the right, etc. But this question is beyond me.
Any help you can provide is greatly appreciated. Thanks!
Tom
GeneratePress 1.3.44February 6, 2017 at 6:43 pm #275331Leo
StaffCustomer SupportHi Tom,
Try something like this in the hook:
<?php if ( is_page( 'page-slug-1' ) ) { ?> tagline #1 <?php } elseif ( is_page( 'page-slug-2' ) ) { ?> tagline #2 <?php } elseif ( is_home() ) { ?> tagline for blog page <?php } else { ?> tagline for all other pages <?php } ?>
Make sure Execute PHP is checked.
Let me know if this makes sense.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 7, 2017 at 1:08 pm #275673Tom
That worked perfectly. Thanks, Leo!
I’m not sure I understand why the “elseif ( is_home()” bit of code affects the blog page, but that’s probably just a WordPress thing (the relationship of Front page and Posts page) that I haven’t grasped yet.
Bottom line is it works! On to climbing the next mountain. Thanks again! Love the theme and the super quick support.
Tom
February 7, 2017 at 4:17 pm #275763Leo
StaffCustomer SupportYup you are right the
is_home()
is just a (old) WordPress thing.
More info here if you are interested: https://codex.wordpress.org/Conditional_TagsYou’re very welcome 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.