Я допустил ошибку, загрузив в Twenty8teenChild полный файл functions.php из twenty8teen
Theme Author
Joy
(@joyously)
I’m glad you got it figured out. (I never saw the notification for this support topic.)
But if you use @import like that, you will get the twenty8teen styles twice. You don’t need to load the parent styles or the child styles. They are loaded for you.
Для подключения дочерних стилей я использую
add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' );
function my_child_theme_scripts() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
@import – очень медленно.
Жалко что приходится общаться через translate. Я хотел бы понять идею папки Cild-demo.
Мне надо учить английский
-
This reply was modified 5 years, 9 months ago by
abiturient.
Theme Author
Joy
(@joyously)
To connect child styles, I use
add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' );
function my_child_theme_scripts() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
@import – very slow
It’s a pity that I have to communicate through translate. I would like to understand the idea of the Child-demo folder.
I need to learn English
For this theme, you do not need to load any styles in the child theme. The parent theme will load them for you. By using the above code, you are loading the parent style twice.
The child-demo is provided to show you how easy it is to make a child theme. You can copy the folder to the wp-content/themes folder and activate it.
You can also make a child theme by having a folder with only a style.css file that contains the standard comment. No styles needed, and no functions.php needed.
I put some comments into the child-demo style.css and functions.php, so maybe that will help explain.
I don’t read Russian, so I have to use translate also.