Tagged: child theme, upgrades
-
AuthorPosts
-
February 9, 2015 at 9:40 pm #393333
Hello,
There are no search results in the forum that answer the following question:
Do you recommend creating a child theme according to this WP Codex: http://codex.wordpress.org/Child_Themes before creating a full site with Enfold?
I don’t want to put a bunch of work into a site without a child theme, then have changes/errors occur when upgrading.
Your expertise is appreciated!
E
February 10, 2015 at 7:27 am #393518Hi!
Yes, we recommend using a Child Theme on any Enfold installation, you can use any method as long as the core components are present (child style.css, functions.php), you can also download a pre-made Enfold child theme here.
Regards,
JosueFebruary 26, 2015 at 5:31 am #402449I’m now implementing your enfold-child theme on a fresh installation and have a question:
I’m following the instructions found at http://codex.wordpress.org/Child_Themes. The functions.php file that comes with your enfold-child theme is mostly blank. Do you recommend we put the .php code shown in the instructions that “enqueue” the parent theme (I have no idea what this means!).
Here’s one of the examples shown. Which one do we use?
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
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’)
);
}Thank You,
Eric
February 26, 2015 at 8:56 pm #402980Hi Eric!
Not necessary, you can leave the child functions.php blank for now. The child theme style.css file is included automatically.
Regards,
JosueFebruary 20, 2017 at 10:18 pm #749626Hello Eric
From what I have understood from the comments above is that the style.css file will get included automatically, but that the functions.php file might not. Does that mean that if I have to make any changes to the functions, I need to add some code to the functions.php file?
I found the following code on a Smashing Magazine tutorial. Please let me know if I should use this.
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); }
February 21, 2017 at 8:20 am #749796Hi @architchandra,
I’m not sure I understand what you are looking to achieve, could you try to explain a bit further please? If you are looking for a child theme then you can download one from here: kriesi.at/documentation/enfold/downloads/
Best regards,
RikardFebruary 21, 2017 at 9:50 am #749842Hi @rikard
What I meant was that I want to make some changes to the functions.php file as well in the child theme. Do I need to use the code that I mentioned earlier or would the functions.php file for the child theme start working automatically?
February 22, 2017 at 6:23 am #750258Hi,
Ok, thanks for that. So you’re asking if you have to have the code snippet you posted in functions.php for have the default style sheet to load? If so then the answer is no, it should load anyway. A child theme will only override the parent, so the parents styles will still be used if you have a child theme active.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.