Allow HTML code in WordPress tagline

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". 

HTML in WordPress Tagline field 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.

12 comments on “Allow HTML code in WordPress tagline

  1. 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

      • 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

  2. Yes, that should work. In that case you would want to do:

    <p class="name"><?php echo html_entity_decode(get_bloginfo('name'));?></p>
    
  3. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to view allowed tags

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.