Maybe its just me but I always feel like the site description or WordPress tagline begs for some styling. Here’s an easy one to use as an example*:
The Future’s Bright. The Future’s orange
In order to output the Tagline most themes use
the get_bloginfo()
function, esc_html( get_bloginfo( 'description' ) )
or just get_bloginfo( 'description' )
Let’s say we wanted to do something like this:
The Future’s Bright. The Future’s orange
In that case you could use the following in your theme:
<h2 class="tagline"><?php echo html_entity_decode(get_bloginfo('description'));?></h2>
And use HTML in your Tagline under "Settings".
There you have it a styleable and dynamic tagline!
*Incidentally I have absolutely no affiliation with this company and chose this example purely because of the colour.
should this work for name?
I am using (left off so code would display
php echo html_entity_decode( bloginfo(‘name’)); ?
it still displays the html in site name
I enabled Markdown in the comments so you can include your code now if you like.
Thanks for the reply. I think I forgot to set notifications so it has bee a while!
<h1><a href="<?php bloginfo('url'); ?>"><?php echo html_entity_decode( bloginfo('name')); ?></a></h1>
This a copy and paste of my code. I still get html displayed as text on the site
Yes, that should work. In that case you would want to do:
I spotted the mistake. I was using
bloginfo('name')
instead ofget_bloginfo('name')
Ah yes, That’ll do it 😉
Glad you got it working.
Hi Kirsten, I’m trying to add the this
<h2 class="tagline"><?php echo html_entity_decode(get_bloginfo('description'));?></h2>
as you suggested, to be able to use html codes on my tagline.
Where should I paste that line at? I am using a non-paid plan, will I be allowed to paste the above-line if I don’t have access to “Custom Design”? Thanks!
Hi JL, you would include that in the WordPress Template corresponding to where you want it to display. I’m not sure what you mean about a paid plan but I’m assuming you mean a basic account on wordpress.com. You can try editing the template files via the Appearance Editor Screen as described here: https://codex.wordpress.org/Appearance_Editor_Screen
This helped me a lot!
Thank you for explaining.~
exactly what I needed. Thanks
This is a seriously great tip, and opens up a world of possibilities! 🙂
Thanks so much, Kirsten.
Firefox shows the HTML in the top-title-bar unfortunately
Thanks