我继承了一个没有子主题的站点,现在我们在更新内容时会遇到问题。这个主题中的所有内容都是围绕主题制作的。。。
我现在已经创建了一个子主题,但我必须将许多脚本和样式表排队,而且我做得不对。主要问题是,我在子主题目录的css文件夹中有这些自定义样式表。但是这些函数在父主题上查找这些文件,因此显然找不到它们。我应该在父css目录上上载自定义样式表吗?或者将其放在我的子主题目录中,并以不同的方式将其排队?
下面是我的功能。php on my child主题外观:
function shopkeeper_styles_child() {
global $shopkeeper_theme_options;
wp_enqueue_style(\'shopkeeper-foundation-app\', get_template_directory_uri() . \'/css/app.css\', array(), \'5.3.1\', \'all\' );
wp_enqueue_style(\'shopkeeper-animate\', get_template_directory_uri() . \'/css/animate.css\', array(), \'2.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-awesome\', get_template_directory_uri() . \'/inc/fonts/font-awesome/css/font-awesome.min.css\', array(), \'4.0.3\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-arrows\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/arrows/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-basic\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/basic/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-basic_elaboration\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/basic_elaboration/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-ecommerce\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/ecommerce/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-music\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/music/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-software\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/software/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-font-linea-weather\', get_template_directory_uri() . \'/inc/fonts/linea-fonts/weather/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-fresco\', get_template_directory_uri() . \'/css/fresco/fresco.css\', array(), \'1.3.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-idangerous-swiper\', get_template_directory_uri() . \'/css/idangerous.swiper.css\', array(), \'\', \'all\' );
wp_enqueue_style(\'shopkeeper-owl\', get_template_directory_uri() . \'/css/owl.carousel.css\', array(), \'1.3.1\', \'all\' );
wp_enqueue_style(\'shopkeeper-owl-theme\', get_template_directory_uri() . \'/css/owl.theme.css\', array(), \'1.3.1\', \'all\' );
wp_enqueue_style(\'shopkeeper-offcanvas\', get_template_directory_uri() . \'/css/offcanvas.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-nanoscroller\', get_template_directory_uri() . \'/css/nanoscroller.css\', array(), \'0.7.6\', \'all\' );
wp_enqueue_style(\'shopkeeper-select2\', get_template_directory_uri() . \'/css/select2.css\', array(), \'3.4.5\', \'all\' );
wp_enqueue_style(\'shopkeeper-easyzoom\', get_template_directory_uri() . \'/css/easyzoom.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-defaults\', get_template_directory_uri() . \'/css/defaults.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-woocommerce-overwrite\', get_template_directory_uri() . \'/css/woocommerce-overwrite.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-top-bar\', get_template_directory_uri() . \'/css/header-topbar.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-headers\', get_template_directory_uri() . \'/css/headers.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-menus\', get_template_directory_uri() . \'/css/navigations.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-custom\', get_template_directory_uri() . \'/shoopkeeper-child/css/custom_artiq.css\', array(), \'1.0\', \'all\' );
if ( isset($shopkeeper_theme_options[\'main_header_layout\']) ) {
if ( $shopkeeper_theme_options[\'main_header_layout\'] == "1" ) {
wp_enqueue_style(\'shopkeeper-header-default\', get_template_directory_uri() . \'/css/header-default.css\', array(), \'1.0\', \'all\' );
}
elseif ( $shopkeeper_theme_options[\'main_header_layout\'] == "2" ) {
wp_enqueue_style(\'shopkeeper-header-centered-2menus\', get_template_directory_uri() . \'/css/header-centered-2menus.css\', array(), \'1.0\', \'all\' );
}
elseif ( $shopkeeper_theme_options[\'main_header_layout\'] == "3" ) {
wp_enqueue_style(\'shopkeeper-header-centered-menu-under\', get_template_directory_uri() . \'/css/header-centered-menu-under.css\', array(), \'1.0\', \'all\' );
}
}
else {
wp_enqueue_style(\'shopkeeper-header-default\', get_template_directory_uri() . \'/css/header-default.css\', array(), \'1.0\', \'all\' );
}
if (isset($shopkeeper_theme_options[\'font_source\']) && ($shopkeeper_theme_options[\'font_source\'] == "2")) {
if ( (isset($shopkeeper_theme_options[\'font_google_code\'])) && ($shopkeeper_theme_options[\'font_google_code\'] != "") ) {
wp_enqueue_style(\'shopkeeper-font_google_code\', $shopkeeper_theme_options[\'font_google_code\'], array(), \'1.0\', \'all\' );
}
}
wp_enqueue_style(\'shopkeeper-styles\', get_template_directory_uri() . \'/css/styles.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-responsive\', get_template_directory_uri() . \'/css/responsive.css\', array(), \'1.0\', \'all\' );
wp_enqueue_style(\'shopkeeper-default-style\', get_stylesheet_uri());
}
add_action( \'wp_enqueue_scripts\', \'shopkeeper_styles_child\', 99 );