,這是我的測試頁電子商務店:https://shop.amir-rahbaran.com/子主題沒有加載從父主題整體風格
這是父樣式: https://colorlib.com/shapely
functions.php:
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css');
wp_enqueue_style('child-style',
get_stylesheet_directory_uri() . '/style.css',
array($parent_style),
wp_get_theme()->get('Version')
);
}
add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');
?>
的身材高大的(父母)和身材嬌小的孩子都位於主題文件夾(相同的層次結構)。
這是我勻稱孩子style.css
:
/*
Theme Name: Shapely-Child
Template: shapely
Theme URI: https://colorlib.com/wp/themes/shapely
Author: colorlib - modified by Sandra J./Amir R.
Author URI: https://colorlib.com/
Description: [...]
Version: 1.0.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shapely
[ ... ]
*/
感謝您的回覆。不幸的是,這並沒有成功。也許我身邊的新信息有所幫助? Thx,Amir –
感謝您提供有關您的孩子主題的更多信息。請參閱上面的修改後的答案。 –
我已經修改了上面的共享函數my_theme_enqueue_styles,所以請嘗試使用它。 –