0

I'm trying to set some <span> tags in the bloginfo description. So I put this in the blog description field:

<span class="name">Archive | Navarro Vives</span> <span>is a point of reference</span> <span>for those who wish to</span> <span>find out more about the life and work of Josep Navarro Vives.</span>

bloginfo('description') returns this string:

&lt;span class=&quot;name&quot;&gt;Archive | Navarro Vives&lt;/span&gt; &lt;span&gt;is a point of reference&lt;/span&gt; &lt;span&gt;for those who wish to&lt;/span&gt; &lt;span&gt;find out more about the life and work of Josep Navarro Vives.&lt;/span&gt;

And it is printed in the browser as <span class="name">Archive | Navarro...etc (with escaped tags).

I tried to:

$description = bloginfo('description');
echo html_entity_decode($description);

but it returns exactly the same as bloginfo('description').

How can I unescape these <span> tags?

0

I found the answer. just replace

bloginfo('description')

by get_bloginfo('description')

So

echo html_entity_decode(get_bloginfo('description'))

Works as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.