Is there a way of adding <strong> tags in WordPress’s description/tagline area

In WordPress administrator -> Settings there’s a tagline / description field:

For example:

Read More
<div id="tagline"><p><?php bloginfo( 'description' ); ?></p></div>

description: I'm a <strong>web</strong> and graphic designer

But it seems like it only allows text not HTMl tags.

Is there any way of doing this o I have to create a new field?

Related posts

Leave a Reply

3 comments

  1. The option is run through a filter that replaces HTML entities, so even if you were to run a filter on that option(which is possible), WordPress replaces the HTML entities, meaning HTML wouldn’t work…

    For example, add this code and watch what happens.

    add_filter( 'option_blogdescription', 'html_blog_description' );
    function html_blog_description( $option_value ) {
        $option_value = '<strong>Test text </strong>'. $option_value;
        return $option_value;
    }
    

    There aren’t any hooks i can see that specifically deal with this option and convert the entities, else i’d have ideas about unhooking that action from the description.

    I think the only solution you really have is to run str_replace over your calls to fecth the blog description. This would mean updating all your calls for bloginfo( 'description' ) with a rountine that performs string replacement on the content.

    eg.

    $description = str_replace(' web ','<strong> web </strong>',get_bloginfo('description'));
    echo $description;
    

    Sure it’s not ideal, but i can’t currently see a more elegant way(though i’d be happy for someone to prove me wrong).

  2. Use html_entity_decode combined with get_bloginfo (instead of bloginfo). So replace:

        <?php bloginfo( 'description' ); ?>
    

    By:

        <?php echo html_entity_decode( get_bloginfo( 'description' ) ); ?>
    

    Note: Tested on WordPress 3.8.1.