This topic has 5 replies, 2 voices, and was last updated 8 years ago ago by Olga Barlow
Hello,
What is the correct way to create a child theme specifically for xstore?
I have created a child theme with only the below in the functions.php based on https://codex.wordpress.org/Child_Themes. Some styling has gone bad. I wouldn’t be surprised if there is other stuff that my child theme is not pulling in correctly that I have not noticed yet 🙁
Some links (not all) have gone blue based on a bootstrap css file, but most are still the colour specified in the dashboard or custom css dashboard.
My botton corner radius settings are being undone by the bootstrap css too.
Very broadly speaking the child is working i.e. it is largely based on my dashboard configuration of xstore and my Custom CSS there, for somethings….
I am sure this is a simple case of me not implementing my first ever child theme correctly…
Many thanks,
R.
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
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' );
?>
login enclosed 🙂
Hello,
We have included child theme archive into theme package. Use it to install child theme.
functions.php of xstore child theme should have the following code at the beginning
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array('bootstrap'));
if ( is_rtl() ) {
wp_enqueue_style( 'rtl-style', get_template_directory_uri() . '/rtl.css');
}
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array('parent-style', 'bootstrap')
);
}
Regards
Fabulous – thanks Olga
You are welcome!
Regards
Tagged: best selling, child theme, correct way, implement, style problem, woocommerce themes, xstore
You must be logged in to reply to this topic.Log in/Sign up