1

I currently use a child theme of the Divi theme. Within this child theme are the modified header.php and footer.php files only, should I store an exact copy of the Divi theme in this child theme. Or just the changed files?

I also wish to remove any reference to the Divi theme. I have re-named my child theme "MySite - Child Theme", but using "view source" it appears to reference the parent Divi theme as well. I assume because the full contents of the theme are stored there.

1
  • First of all, only geeks (in a positive sense) look at source code. Secondly, you would require a lot of pointless filtering which causes some pointless extra load on server. If you're good at programming and you're planning to maintain and improve your theme yourself, just change the original theme (no more official updates!), if not: don't do it and try to calm yourself with a fact that "regular" people don't look at source code and don't even know what it is.
    – N00b
    Commented Feb 18, 2016 at 13:01

1 Answer 1

1

You should not store an exact copy of the Divi theme in your child theme, there is little point to that.

Your child theme stylesheet will reference the parent theme directory name in the template attribute within the header of your stylesheet:

/*
 Theme Name: Your Child
 Template: divi
 //shortened for brevity...
*/

The parent theme will load resources, in particular assets like CSS, JavaScript and images where by the path includes the parent theme name:

http://example.com/wp-content/themes/divi/style.css
http://example.com/wp-content/themes/divi/script.js
//etc...

If you want to completey hide the fact that you are using "divi" as your parent, you can rename the directory to something of your choosing, e.g. from divi to custom-parent.

Then you can open the Divi stylesheet and rename all references to "divi" and replace it with something of your choosing, again e.g. custom-parent or similar. Slugs for slugs, titles for titles.

You might want to use a grep tool to search and replace public instances.

If you do this, anytime Divi has a parent theme update you will need to rinse and repeat the process.

There are probably other things you can do like filtering paths and so forth.

...but honestly why bother?

If I look at the source of your site, I'd be able to tell, if I wanted to, if you are using Divi or some other site builder often by the classes, IDs and other markers the framework injects into the DOM.

The purpose of your child theme is to extend the parent theme so that it the parent meets your needs, often, becoming your own creation. Who really cares what framework you use as a means to an end?

2
  • So if I only want to change the header.php and footer.php, thats all I need to store in my child theme folder? Does the database treat the parent and child theme as two seperate sites? So if I make a db change to my child theme, will it still apply if I switched back to parent theme?
    – flint781
    Commented Feb 18, 2016 at 13:12
  • 1
    @flint781 , You must also add a style.css to your child theme look here in the codex how it is done. It is also wise to add a functions.php in the child theme for moments you wish to make/add changes with functions. Why the cssfile also you will think, it is because WordPress needs to regconize your "own" theme so you can select it in the Admin area under Appearance/Themes. Please do not change any in your database directly, when there is no urgent reason to be.
    – Charles
    Commented Feb 18, 2016 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.