Archived topic
Display a phrase above the logo
3 replies · Started by twarrior on August 25, 2022
Hello,
Some time ago I asked a question about how to put the Tagline above the logo, and the solution worked... (until now ;-)
https://generatepress.com/forums/topic/display-the-tagline-above-the-logo/
Now the problem is that we need that sentence above the logo to have a specific style (each word goes in a different colour).
<span style="colour: #fff;">first part</span> <span style="colour: #1C9FAD;">second part</span>.
The solution of inserting in the "tagline" field of wordpress that code works, but when displaying the Tagline in the Title of the Web (browser tab, Google results, etc.) it comes out with the code.
So, what is your solution? Is it possible to insert that formatted text on top of the logo using Hooks?
thanks
Hi there,
you would need to hook in the HTML instead using this PHP Snippet:
add_filter( 'generate_site_description_output', function() {
return sprintf(
'<p class="site-description"%s>
Your custom tagline
</p>',
'microdata' === generate_get_schema_type() ? ' itemprop="description"' : ''
);
} );
Replace the Your custom tagline with your HTML.
WORKS GREAT
thaaaanks
Glad to hear that!