[Resolved] Page hero template tags “tagline”

Home Forums Support [Resolved] Page hero template tags “tagline”

Home Forums Support Page hero template tags “tagline”

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1320957
    Bernhard

    Hello,
    is it possible to address the tagline as template tag?
    As I’m using polylang it would be better than creating an element for every language.

    #1321114
    Leo
    Staff
    Customer Support

    Hi there,

    Sorry I don’t quite understand the question.

    What are you trying to achieve?

    I don’t see a page hero in the page you’ve linked.

    Let me know 🙂

    #1321234
    Bernhard

    Ah sorry, the page was set to private.
    I’m thinking about a new layout for the homepage and my idea is set the title tag instead of {{post_title}}.

    #1321387
    Leo
    Staff
    Customer Support

    Still don’t really understand.

    You can add whatever you want inside the page hero content.

    If this doesn’t help, can you link me to an example of what you’d like to achieve?

    #1321635
    Bernhard

    In my case, I have the Site Title

    Rom Tourismus | Tourist in Rom | Dein Online Reiseplaner

    and the Tagline

    Tourist in Rom

    Now I want to insert the tagline instead of <h1>{{post_title}}</h1>

    I tried with <h1>{{tagline}}</h1> but the output is {{tagline}}

    I understood that it shall be possible to address every field in the page hero content. So, if it works like this, I need to know the field name of the tagline.

    If possible, it would be good to insert also the Site Title, on desktop only.

    #1321793
    David
    Staff
    Customer Support

    Hi there,

    there are no template tags for the Site Title or Site Description.
    You could create a shortcode with a PHP snippet like this:

    add_shortcode( 'tagline', function() {
        ob_start();
        printf( esc_html__( '%s', 'generatepress' ), get_bloginfo ( 'description' ) );
        return ob_get_clean();
    } );

    then you can add [tagline] to your header element.

    If that works then you can create another for the Site Title:

    add_shortcode( 'site-title', function() {
        ob_start();
        printf( esc_html__( '%s', 'generatepress' ), get_bloginfo ( 'name' ) );
        return ob_get_clean();
    } );

    And this shortcode [site-title]

    #1322582
    Bernhard

    Perfect, thank you.

    #1323135
    David
    Staff
    Customer Support

    You’re welcome

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