[Resolved] How do I display (slightly) different taglines on different pages?

Home Forums Support How do I display (slightly) different taglines on different pages?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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.44
    #275331
    Leo
    Staff
    Customer Support

    Hi 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.

    #275673
    Tom

    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

    #275763
    Leo
    Staff
    Customer Support

    Yup you are right the is_home() is just a (old) WordPress thing.
    More info here if you are interested: https://codex.wordpress.org/Conditional_Tags

    You’re very welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.