Forum Replies Created
-
AuthorPosts
-
Hi,
Sorry for unclear description.
It means that after activating child theme whole settings are set do default so the website looks totally different.I am aware that after activating the child theme i should somehow import the style data from the parent theme but as it is stated in wordpress develpers resources quoted above using import functions is not correct anymore.
So i’m trying to do it as they recommend by adding a code to the function php of child theme. The code is also in my second post but it is not working. I would like to ask you to look at this code and advise what i could change to make it work for enfold theme. They also suggesting that this code work only for themes where all style options are cover by one file style.css, otherwise there is additional procedure.
Is what i want to achieve clear now?
Hi there,
I have read this thread and i would like to ask to update the information. As we can read here:
The import of settings from parent theme isn’t the best way for now.
So i have tried to activate child theme and instead if importing settings i added following code to the functions.php of child theme:
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); 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') ); }
But nothing changed (the sites looks way different than my original site in parent theme).
Could you clarify why it isn’t work?
I may find solution here:
but in that code below, should I replace the “parent-style” with some other $handle?
And the second question – they wrote that it will work only if theme has one .css file. Do enfold have one or more?
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); 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') ); }
Never mind, you can close this case, sorry :)
-
AuthorPosts