1
我有一个功能,会自动添加在我的标题的跨度,这样我可以样式的跨度,如:WordPress的高级自定义字段get_content
<h2><span>my heading</span></h2>
这在我的正常的WordPress含量正常,但中的内容高级自定义字段将其删除。有没有人有任何想法 - 花了数小时搜索。
//add span into each title so can add flourish under span
add_filter('the_content', 'replace_content',1);
function replace_content($content) {
$content = preg_replace('/<h(\d{1,6})(.*?)>(.*?)<\/h(\d{1,6}).*?>/', '<h$1><span>$3</span></h$4>', $content);
return $content;
}
非常感谢任何人谁可以帮助!