Archived topic
html tags in site title
8 replies · Started by Anonymous on November 7, 2015
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.
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.
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 :)
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?
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.
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?
Make sure you added it to the "Before Header Content" hook, and not the "Before Header" hook.
That was the problem. Now it's perfect. Thanks!
You're welcome :)
