Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从wp_头中删除特定样式_Php_Wordpress - Fatal编程技术网

Php 从wp_头中删除特定样式

Php 从wp_头中删除特定样式,php,wordpress,Php,Wordpress,我不是一个可湿性粉剂开发者,我想帮助一个有可湿性粉剂网站的朋友 问题就在这里 在模板wp_head()中,函数添加了一系列样式和脚本,如 我想删除一些页面中的一些,比如说这一页 <link rel='stylesheet' id='yasrcss-css' href='https://www.example.com/wp-content/plugins/yet-another-stars-rating/css/yasr.css' type='text/css' media='all' /

我不是一个可湿性粉剂开发者,我想帮助一个有可湿性粉剂网站的朋友 问题就在这里

在模板
wp_head()
中,函数添加了一系列样式和脚本,如

我想删除一些页面中的一些,比如说这一页

<link rel='stylesheet' id='yasrcss-css'  href='https://www.example.com/wp-content/plugins/yet-another-stars-rating/css/yasr.css' type='text/css' media='all' />
它不起作用,我还添加了这个fo function.php

wp_deregister_style('yasrcss-css');
这个没用

我是否遗漏了什么,还有什么我应该做的吗

顺便说一句,我试过这个代码

printf( 
    '<pre>%s</pre>', 
    var_export( $GLOBALS['wp_scripts']->registered, TRUE )
);
printf(
“%s”,
变量导出($GLOBALS['wp_scripts']->已注册,TRUE)
);
正如这里所建议的


我不知道输出

WP
init
hook中的粒子css不用于加载/卸载资产。您可以尝试改用:

printf( 
    '<pre>%s</pre>', 
    var_export( $GLOBALS['wp_scripts']->registered, TRUE )
);
// Replace

add_action('init', '_remove_style');

// With

add_action('wp_loaded', '_remove_style');