只有我的子主题的样式表中的某些样式正在应用于我的站点,而其他样式被忽略,而我的父主题的样式正在被应用。有什么想法吗?
子主题的functions.php
<?
add_action ('wp_enqueue_scripts',
'senorpicoculinary_child_and_parent_stylesheets');
function senorpicoculinary_child_and_parent_stylesheets() {
wp_enqueue_style(
'parent-style',
get_template_directory_uri().'/assets/stylesheet.css');
/* For the child style, I didn't use get_directory_uri() because
that seems to point to style.css, and our styling file is stylesheet.css*/
wp_enqueue_style(
'child-style',
get_stylesheet_directory_uri().'/assets/stylesheet.css');
}
?>
父主题functions.php
function add_theme_scripts() {
wp_enqueue_style(
'generic-style',
get_stylesheet_directory_uri().'/style.css');
wp_enqueue_style(
'favicon',
get_template_directory_uri().'/favicon.ico');
wp_enqueue_style(
'bootstrap',
get_template_directory_uri(). '/assets/bootstrap.min.css');
wp_enqueue_style(
'megamenu-stylesheet',
get_template_directory_uri(). '/assets/megamenu.css');
wp_enqueue_style(
'webfont-kit',
get_template_directory_uri().'/assets/MyFontsWebfontsKit.css');
wp_enqueue_style(
'tv-style',
get_template_directory_uri().'/assets/stylesheet.css');
}
add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
?>
CSS子主题:
h1 {
font-family: 'momoco_inlineinline'; //doesn't work
color: blue; //works
}
body {
background-color: black; // doesn't work
}
父主题CSS (全部应用,而不是我的子主题的样式)
h1 {
font-size: 1.4em;
margin: 0 0 .5em 0;
font-family: AvenirLT-Roman;
border-bottom: 1px solid #CCCCCC;
}
body {
background-color: #F1F1F1;
margin: 0;
padding: 0;
font-size: 100%;
font-family: AvenirLT-Roman;
}
https://stackoverflow.com/questions/51371011
复制相似问题