开发者

Wordpress: force not HTML escape in text widget?

开发者 https://www.devze.com 2023-02-04 22:46 出处:网络
I\'m using Wordpress with the Twitter Pro widget, and I want to include a link in the title. (Actually an image and a link, but keeping the question simple...)

I'm using Wordpress with the Twitter Pro widget, and I want to include a link in the title. (Actually an image and a link, but keeping the question simple...)

I'm using the following code in a Wordpress text widget in the sid开发者_运维知识库ebar.

[twitter-widget username="myname" items="5" hiderss="true" 
title="<a href='#'>My Title</a>" hidereplies="true"][/twitter-widget]

It works in my version of Chrome, but Firefox HTML-escapes the title, and I end up with:

<a href='#'>My Title</a>

visible to the naked eye in my sidebar.

What can I do? Is there a way I can force the browser not to HTML-escape this?

Thanks!


Check if your theme(functions.php) or widget has this code inside it:

add_filter('widget_text', 'do_shortcode');

since you are using shortcodes in widget which are not allowed by default in wordpress.

0

精彩评论

暂无评论...
验证码 换一张
取 消