4
我需要更改或使用插件
例如<title> My old title </title>
=><title> New title </title>
如何使用plugin,add_filter在wordpress中刪除或更改<title>標籤?
刪除<title>
標籤在WordPress我嘗試
function plugin_title($content){
$content=str_replace('My old title','New title',$content);
return $content;
}
add_filter('wp_head','plugin_title');
//但它不工作。任何想法 ?
可能重複的具體實施方法來解析用PHP HTML(http://stackoverflow.com/questions/3577641/best-methods-to-parse-html-與-php) – ajreal
不是真的,這是Wordpress特定的。 – cmbuckley
@cbuckley只要與HTML解析相關,是不是很難轉換它DomDocument – ajreal