【发布时间】:2018-02-28 01:41:46
【问题描述】:
css 不工作。这很奇怪,因为当我使用浏览器检查器查看它时,我在 html 的头部看到它......但它没有拾取我添加到它的新 css。我试着清理我的渔获。这是我的孩子主题 style.css
/*
Theme Name: Venedor Child
Template: venedor
Version: 1.0
*/
.select2-container .select2-selection--single .select2-selection__rendered {
padding-left: 164px!important;
}
#s2_form_widget-2 form {
display: none;
}
a.checkout-button.button.alt.wc-forward {
display: none;
}
p.alert.alert-success {
font-weight: bold;
font-size: 1.3em;
}
textarea#order_comments {
font-weight: bold;
font-size: 1.5em;
line-height: 1.4em;
}
这是我孩子的主题functions.php
<?php
add_action( 'wp_enqueue_scripts', 'venedor_child_enqueue_styles', 33 );
function venedor_child_enqueue_styles() {
$parent_style = 'style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'venedor-child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
任何想法???...我再次在我的页面顶部看到子主题样式表...只是我在 wp-admin 编辑器中所做的更改没有。谢谢!
【问题讨论】:
-
您是否验证过正在加载子主题 CSS 文件?不只是一个
<link>出现在头上?子主题中的 CSS 选择器是否比父主题中的选择器更具体或更具体?您是否通过开发工具验证了上述任何一项? -
“它不工作”是什么意思?请说明您想要的结果是什么,以及它与实际发生的结果有何不同。
标签: css wordpress child-theming