Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] html tags in site title

Home Forums Support html tags in site title

  • This topic has 8 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #151167
    Allen

    I’m new to WordPress. I read some themes will correctly render html tags embedded in the site title. The GeneratePress theme apparently will not. By this I mean, if I insert <sup><small>SM</small><sup> in the site title, I would like to see a small superscripted SM, not the literal string “<sup><small>SM</small><sup>”. One post I saw suggested editing header.php to change bloginfo(‘description’) to echo html_entity_decode(get_bloginfo(‘description’)). GeneratePress doesn’t have this in header.php.

    What do I need to do with GeneratePress to get html tags to render correctly in the site title? Thanks.

    #151170
    Allen

    P.S., I purchased the full set of GeneratePress add-on’s, and maybe GP Hooks would help me do this, but I don’t see any real documentation on this.

    #151171
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    First you’ll want to go to “Customize > Site Identity” and disable the title and tagline.

    Then go to “Appearance > GP Hooks” and add your title and tagline to the “Before Header Content” hook:

    <div class="site-branding">
    	<p class="main-title" itemprop="headline"><a href="YOUR URL" title="YOUR TITLE" rel="home">YOUR TITLE WITH HTML</a></p>
    	<p class="site-description">YOUR TAGLINE IF NECESSARY</p>
    </div>

    That should do it 🙂

    #151172
    Allen

    Could I also do this with a generate_show_title filter? If so, what menu item on the dashboard allows me to add a filter?

    #151173
    Tom
    Lead Developer
    Lead Developer

    The generate_show_title filter is for the content title – it determines whether to show it or not.

    The best/easiest way to do have full control over the HTML of your title is using GP Hooks.

    #151175
    Allen

    The html you gave me only kinda worked. It moved the title out of its padded white area and into an unpadded light blue area. How do I move it into the padded white area?

    #151176
    Tom
    Lead Developer
    Lead Developer

    Make sure you added it to the “Before Header Content” hook, and not the “Before Header” hook.

    #151182
    Allen

    That was the problem. Now it’s perfect. Thanks!

    #151183
    Tom
    Lead Developer
    Lead Developer
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.