I know this thing has been posted several times now, but I can't figure it out. I am asking for your help. I have created theme child before, for other WordPress themes, but this one is giving me hard times.
The theme is called: neobeat
My CSS files look like this:
Theme Name: Neobeat Child
Theme URI: http://example.com/
Description: Neobeat Child Theme
Author: Something
Author URI: http://example.com
Template: neobeat
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive layout
Text Domain: neobeat-child
and my functions.php file looks like this:
add_action( 'wp_enqueue_scripts', 'neobeat_child_enqueue_styles' );
function neobeat_child_enqueue_styles() {
$parent_style = 'neobeat-theme-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() .
'/style.css' );
wp_enqueue_style( 'style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
the $handle in the parent folder in functions.php looks like this:
wp_enqueue_style( 'neobeat-theme-style', get_stylesheet_uri(),
array( 'font-awesome', 'material-icons', 'magnific-popup',
'linear-icons' ), NEOBEAT_THEME_VERSION );
When I upload the files in neabeat-child folder:
- all the CSS files from the array are not loaded: font-awesome, material-icons, linear-icons
- the order of the CSS files is not the same, it changes order
get_template_directory_uri()
gives you the path to the parent theme. For the child theme you should useget_stylesheet_directory_uri()
.