本文整理自网络,侵删。
代码如下:
<?php
/*
Plugin Name: WPJAM HTML Widget Title
Description: 让 Widget 标题支持简单的 HTML 标签
Version: 0.1
Author: Denis
*/
add_filter( 'widget_title', 'wpjam_html_widget_title' );
function wpjam_html_widget_title( $title ) {
//HTML tag opening/closing brackets
$title = str_replace( '[', '<', $title );
$title = str_replace( '[/', '</', $title );</p> <p> //<strong></strong>
$title = str_replace( 's]', 'strong>', $title );
//<em></em>
$title = str_replace( 'e]', 'em>', $title );</p> <p> return $title;
}
?>
<?php
/*
Plugin Name: WPJAM HTML Widget Title
Description: 让 Widget 标题支持简单的 HTML 标签
Version: 0.1
Author: Denis
*/
add_filter( 'widget_title', 'wpjam_html_widget_title' );
function wpjam_html_widget_title( $title ) {
//HTML tag opening/closing brackets
$title = str_replace( '[', '<', $title );
$title = str_replace( '[/', '</', $title );</p> <p> //<strong></strong>
$title = str_replace( 's]', 'strong>', $title );
//<em></em>
$title = str_replace( 'e]', 'em>', $title );</p> <p> return $title;
}
?>
相关阅读 >>
wordpress实现的首页幻灯片展示功能示例【附demo源码】
wordpress 相册插件 nextgen-gallery 添加目录将中文转为拼音的解决办法
wordpress合理利用wp-config.php文件小功能
更多相关阅读请进入《wordpress》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。