Wordpress 如何根据内容动态设置标题?
我尝试使用内容中的数据设置自定义标题。这些不是我正在修复的页面或posts-plugin(chaturbate),它们以某种方式处理URL,比如/lala fafa,而posts表中没有任何条目 这是我的密码Wordpress 如何根据内容动态设置标题?,wordpress,plugins,title,Wordpress,Plugins,Title,我尝试使用内容中的数据设置自定义标题。这些不是我正在修复的页面或posts-plugin(chaturbate),它们以某种方式处理URL,比如/lala fafa,而posts表中没有任何条目 这是我的密码 add_filter( 'the_title', 'chfix_alter_title', 9999); function chfix_alter_title($title, $id=null) { global $chfix_values; return "$chfix_
add_filter( 'the_title', 'chfix_alter_title', 9999);
function chfix_alter_title($title, $id=null)
{
global $chfix_values;
return "$chfix_values[Name] $chfix_values[Age]...";
}
add_filter( 'the_content', 'chfix_doit', 9999 );
function chfix_doit($content)
{
global $chfix_names, $chfix_values;
if (!is_admin())
{
foreach($chfix_names as $name)
{
// parsing content
$chfix_values = chfix_get_field($content, $name);
}
}
return $content;
}
问题是在内容过滤器之后调用了标题过滤器。我还尝试了wpseo_title,widget_title,但运气不好。是否可以制作我想要的内容?意味着您必须设置标题页?我想从内容中获取一些数据,并在标题中使用。动态地。事实上,它们不是页面或帖子,我想这是通过处理404错误来完成的。你能给我一个例子,包括一些内容和标题,这样我可以帮助你吗?