【发布时间】:2011-11-12 23:07:08
【问题描述】:
我需要使用插件更改或删除 wordpress 中的 <title> 标签
例如<title> My old title </title> => <title> New title </title>
我试试
function plugin_title($content){
$content=str_replace('My old title','New title',$content);
return $content;
}
add_filter('wp_head','plugin_title');
// 但它不起作用。任何想法 ?
【问题讨论】:
-
不是真的,这是 Wordpress 特有的。
-
@cbuckley 只要是和HTML解析有关的,转换DomDocument不是那么难
-
@ajreal:不。这与 Wordpress 如何实现插件有很大关系。
标签: php wordpress plugins title add-filter