Site logo

Archived topic

How to Create Child Theme with Existing Genesis Premium Settings

16 replies · Started by Chitika on August 12, 2020

Viewing posts 1–15 of 17

I have made changes to the existing theme which includes functions.php and CSS.
I want to make a child theme of it, so no changes are overwritten in the next update of GP.

How about copying the "generatepress" folder under wp-content/themes to a new folder like "gp-xxxx" which act as a child theme. Then I can activate this theme from Wordpress dashboard. This way I can keep all the changes I made till now.

Is that correct ?

No - that would just be making a copy of GeneratePress and all of its code.
And this new copy would not receive any updates.

Child Themes should only contain 'replacement' or 'additional' code.

One more clarification.
I made changes using Appearance > Customize > GeneratePress > Additional CSS.

I added some code here. Will I lose these changes when I make a new child theme as mentioned above.
https://docs.generatepress.com/article/using-child-theme/

This part confuses me.

The only time you risk losing changes is when you make them to the parent theme files or use the Additional CSS field from WordPress.

Additional CSS is saved in the Theme. You will need to copy and paste that into your child theme styles.css or into additional CSS once the child theme is enabled.

As I understand these are following things to be done for my customization.

1. Copy the parent functions.php file which has some customization to child theme, which is blank.
2. Copy the additional css to style.css of child theme.

So next time, when update to parent GP theme happens, these changes remain intact.

Right?

Your child theme must ONLY contain your Custom Functions. It cannot have any of GP's functions inside it.

Oh. I just copied the entire file.
What about style.css, is it the same.
Only the additional code has to be copied.

You don't need to copy the style.css from the parent theme to your child theme.

The child theme will grab that file for you automatically.

Ok, so if i add the ADDITIONAL CSS code to style.css of parent theme, is it enough.
do i need to add to style.css of child theme also.

What about this part.

If the child theme’s style.css file is empty and you’d like to avoid loading it, try this PHP snippet below:

add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'generate-child' );
}, 50 );

should i add the above PHP code if i make changes to parent theme style.css

Ok, so if i add the ADDITIONAL CSS code to style.css of parent theme, is it enough.

Don't do that - it will get erased during updated.

Simply add your Additional CSS in child theme's style.css and you are done.

what about content added to footer bar.
Before the recent GP Premium plugin update, I added some HTML/TEXT code to footer bar.
This got deleted when the plugin update was done.

So what about the settings from Customize > GeneratePress.
Do they remain even after update like font size, header bar etc.

Or is it better to have a child theme for that.

The basic rules are this:

1. Never edit the parent theme files. Those changes will be lost when the Theme updates. This is controlled by WordPress and the theme has no control over that.

2. Some customizer changes such as Logos, Copyright and Additional CSS are stored in the Theme database. So those will need to be copied to a new / child theme.

https://docs.generatepress.com/article/using-child-theme/#will-i-lose-my-changes-when-i-add-a-child-theme

3. All Customizer changes, activated modules and elements etc. are stored in your sites database. Any changes you made in the Parent Theme will still be present in the child theme.

This archived topic is closed to new replies.