【发布时间】:2016-10-01 15:18:20
【问题描述】:
这是我的测试页电子商务商店: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' );
?>
shapely-master(父级)和 shapely-child 都位于 theme 文件夹中(相同的层次结构)。
这是我的身材匀称的孩子 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
[ ... ]
*/
【问题讨论】:
标签: php css wordpress wordpress-theming