admin管理员组

文章数量:1431307

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?

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?

Share Improve this question edited Apr 20, 2019 at 6:18 aitor asked Apr 18, 2019 at 14:49 aitoraitor 7252 gold badges8 silver badges23 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I found the answer. just replace

bloginfo('description')

by get_bloginfo('description')

So

echo html_entity_decode(get_bloginfo('description'))

Works as expected.

本文标签: phpHTML tags in bloginfo description