jjzjj

php - 在单页上禁用 Wordpress Yoast SEO

我试图在单个页面上禁用WordpressYoastSEO,因为它与其他插件冲突。我试着按照这个StackOverflowquestion,将此代码添加到functions.php:add_action('template_redirect','remove_wpseo');functionremove_wpseo(){if(is_page(944)){global$wpseo_front;remove_action('wp_head',array($wpseo_front,'head'),2);//上面的方法没有用,所以我遇到了thispost,并尝试将其更改为以下,这当然会导致500

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

php - 使用过滤器 wpseo_title 更改标题标签

我试图更改标题标签并添加一个变量(产品品牌),但该变量没有显示。add_filter('wpseo_title','filter_product_wpseo_title');functionfilter_product_wpseo_title(){return'hello'.$_GET[$mysite_slugs['product-brand']].'hello';};}也试过这个但是没有成功add_filter('wpseo_title','filter_product_wpseo_title');functionfilter_product_wpseo_title(){$produ