草庐IT

wordpress - 使用 wpseo_title 函数更改 yoast 标题

我正在尝试设置页面的标题(由自定义主题制作)这是我的代码,但由于某种原因它没有获得“$forumId”参数$forumId=999;add_filter('wpseo_title','filter_product_wpseo_title');functionfilter_product_wpseo_title(){return'Myid='.$forumId;} 最佳答案 您需要将$forumId设置为全局变量。请参阅下面的更新代码。global$forumId;$forumId=999;add_filter('wpseo_titl