Answer the question
In order to leave comments, you need to log in
How to include styles from a parent WordPress theme?
Decided to make a child theme based on the indreams theme. I did all the first steps to create a child theme:
1. Created a folder with the name of the child theme "indreams-child".
2. Added a style.css file with the following content in it
/*
Theme Name: Дочерняя тема indreams
Template: indreams
*/
// импортируем стили родительской темы
@import url("../indreams/style.css");
// Свои дополнительные стили
.foo{ color:red; }
function indreams_child_enqueue_styles() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_style( 'indreams-Arvo', indreams_font_url(), array(), null );
wp_enqueue_style('indreams-flexslider-css', get_template_directory_uri() . '/css/flexslider.css');
wp_enqueue_style('indreams-font-awesome-css', get_template_directory_uri() . '/css/font-awesome.css');
wp_enqueue_style('indreams-bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css');
wp_enqueue_style('indreams-superfish-css', get_template_directory_uri() . '/css/superfish.css');
wp_enqueue_style('indreams-animate-css', get_template_directory_uri() . '/css/animate.css');
wp_enqueue_style('indreams-prettyPhoto-css', get_template_directory_uri() . '/css/prettyPhoto.css');
wp_enqueue_style('indreams-meanmenu-css', get_template_directory_uri() . '/css/meanmenu.css');
}
add_action( 'wp_enqueue_scripts', 'indreams_child_enqueue_styles' );
Answer the question
In order to leave comments, you need to log in
The error was that I named the functions.php file incorrectly!
Function.php instead of functions.php
Thank you all for your replies
https://youtu.be/W3XOzN9Q9ww?t=8m43s - rewinded to 8:43. Did the same - everything works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question