有没有办法让我的style.css
(和其他样式表)在某个插件将其样式排队后?
具体来说,我想要style.css
覆盖cforms的样式,但当我更改add\\u操作的优先级时,它不会做任何事情。
以下是我所拥有的:
function rm_theme_styles()
{
wp_register_style( \'rm_styles\', get_template_directory_uri() . \'/style.css\', array(), null, \'all\' );
wp_register_style( \'jquery.fancybox\', get_template_directory_uri() . \'/js/libs/fancybox/jquery.fancybox-1.3.4.css\', false, null, \'screen\' );
// enqueing:
wp_enqueue_style( \'rm_styles\' );
wp_enqueue_style( \'jquery.fancybox\' );
}
add_action(\'wp_enqueue_scripts\', \'rm_theme_styles\',10);
C表格:
### some css for positioning the form elements
function cforms_style() {
global $wp_query, $cforms_root, $localversion, $cformsSettings;
### add content actions and filters
$page_obj = $wp_query->get_queried_object();
$exclude = ($cformsSettings[\'global\'][\'cforms_inexclude\'][\'ex\']==\'1\');
$onPages = str_replace(\' \',\'\',stripslashes(htmlspecialchars( $cformsSettings[\'global\'][\'cforms_inexclude\'][\'ids\'] )));
$onPagesA = explode(\',\', $onPages);
if( $onPages==\'\' || (in_array($page_obj->ID,$onPagesA) && !$exclude) || (!in_array($page_obj->ID,$onPagesA) && $exclude)){
if( $cformsSettings[\'global\'][\'cforms_no_css\']<>\'1\' )
echo \'<link rel="stylesheet" type="text/css" href="\' . $cforms_root . \'/styling/\' . $cformsSettings[\'global\'][\'cforms_css\'] . \'" />\'."\\n";
### add jQuery script & calendar
if( $cformsSettings[\'global\'][\'cforms_datepicker\']==\'1\' ){
wp_enqueue_script(\'jquery\',false,false,false,false);
wp_enqueue_script(\'jquery-ui-core\',false,false,false,false);
wp_enqueue_script(\'jquery-ui-datepicker\',false,false,false,false);
}
echo \'<script type="text/javascript" src="\' . $cforms_root. \'/js/cforms.js"></script>\'."\\n";
}
}
}
add_filter(\'wp_head\', \'cforms_style\');