我已将一个新的样式表rk加入队列。css最终我希望它在所有其他插件css等覆盖任何css之后最后加载。
我的职能如下。my child主题的php:
add_action( \'wp_enqueue_scripts\', \'my_theme_enqueue_styles\' );
function my_theme_enqueue_styles() {
wp_enqueue_style( \'parent-style\', get_template_directory_uri() . \'/style.css\' );
wp_enqueue_style( \'rk-gp-child-style\', get_stylesheet_directory_uri() . \'/css/rk.css\' );
wp_enqueue_script( \'rkscript\', get_stylesheet_directory_uri() . \'/js/rkscript.js\',array( \'jquery\' ));
}
在我的网站上,css加载如下:
<link rel=\'stylesheet\' id=\'parent-style-css\' href=\'....../wp-content/themes/generatepress/style.css?ver=5.0.3\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'rk-gp-child-style-css\' href=\'....../wp-content/themes/rodkits-gp-child/css/rk.css?ver=5.0.3\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'generate-style-grid-css\' href=\'....../wp-content/themes/generatepress/css/unsemantic-grid.min.css?ver=2.2.2\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'generate-style-css\' href=\'....../wp-content/themes/generatepress/style.min.css?ver=2.2.2\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'generate-mobile-style-css\' href=\'....../wp-content/themes/generatepress/css/mobile.min.css?ver=2.2.2\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'generate-child-css\' href=\'....../wp-content/themes/rodkits-gp-child/style.css?ver=1551420367\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'font-awesome-css\' href=\'....../wp-content/plugins/learnpress/assets/css/font-awesome.min.css?nocache=1551422264.2967&ver=3.2.5.2\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'learn-press-css\' href=\'....../wp-content/plugins/learnpress/assets/css/learnpress.css?nocache=1551422264.2967&ver=3.2.5.2\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'jquery-scrollbar-css\' href=\'....../wp-content/plugins/learnpress/assets/js/vendor/jquery-scrollbar/jquery.scrollbar.css?nocache=1551422264.2967&ver=3.2.5.2\' type=\'text/css\' media=\'all\' />
所以我想我应该为jquery滚动条添加一个依赖项,即现在的函数。php具有:
wp_enqueue_style( \'rk-gp-child-style\', get_stylesheet_directory_uri() . \'/css/rk.css\',array(\'jquery-scrollbar\') );
然而,这只是移动jquery。滚动条。在rk之前加载css。css
帮助