Internal Child Theme
-
Well im just thinking…
Creating a child theme and putting codes under the codes of the primary/parent CSS are the same right? Isnt it it will produce the same results? Or if not, which is better? which is faster in terms of page loading?
-
Creating a child theme and putting codes under the codes of the primary/parent CSS
If you mean putting CSS in the child theme directory style.css, then yes they are the same thing.
If you mean modifying anything the the parent theme directory, then no. And if that’s what you mean, don’t do that.
Or if not, which is better? which is faster in terms of page loading?
It’s on the same server so having a Child theme will not be faster or slower in in terms of page loading.
Thankyou for your reply.
If you mean modifying anything the the parent theme directory, then no. And if that’s what you mean, don’t do that.
Can you explain to me why? Isn’t it if you will put codes UNDER the existing codes of style.css of the theme you are working on, it will prioritize the codes below that you put?
Sorry Im not sure if what i’ve said is right..
pls correct me.Thankyou
You’re correct about the CSS question, but you’re missing the point of a child theme. The goal of child themes is to keep your changes separate from the parent theme. If you edit the parent directly, all of your changes will be lost the next time the parent is updated — even if you don’t ever plan to switch themes, consider that the parent theme may be updated for a security issue or some feature nobody’s dreamed of yet.
Can you explain to me why? Isn’t it if you will put codes UNDER the existing codes of style.css of the theme you are working on, it will prioritize the codes below that you put?
You are correct: changes in the
style.cssfile at the bottom will get the final say (those changes will be prioritized).But you really don’t want to modify the parent theme
style.cssbecause you don’t want your changes wiped out when you update the parent theme. Updates happen all the time for bug fixes or for security vulnerabilities. You should keep them up to date for those reasons.Once of the big advantages of child themes is the ability to maintain your work separate from the original theme. That way if there is an update to the parent theme, you can usually update the parent theme without impacting your work.
Here’s a current example. I have a theme that I’m updating for my site. I want to add a random header background, add rounded corners to the header, and move some header items over a little. Also I’m going to change the body background color.
I could modify my theme’s style.css and add it there but when I update that theme for any reason I’ll probably lose my changes. So I play it safe and create a new directory in
wp-content/themescalledchild-themeand put thisstyle.cssin there./* Theme Name: Some Child Theme Description: Child theme for Jan's theme Author: Jan Dembowski Template: parent-theme-directory */ @import url("../parent-theme-directory/style.css"); /* write custom css below */In my WordPress dashboard I activate the theme listed as “Some Child Theme”. Now when I want to make my changes, all I have to do is edit
wp-content/themes/child-theme/style.cssand that’s it. I just add the new CSS there and I’m all set.If the parent theme needs upgrading, it will not impact my changes at all.
Thanks for your replies! I am now enlightened 😀
The only thing why I dont like child theme is that, when editing a parent theme with MULTIPLE css files, once the child theme is activated, sometimes its not working properly. Sometime some parts of the parent theme are not inherited. Especially when your editing complicated themes like premium themes.
Can you give me some PRO TIPS about editing themes with multiple css.
Thanks! 🙂
PS: I hope Im not disturbing you alot. I know just answering my questions will consume minutes. Thankyou for spending time.
The topic ‘Internal Child Theme’ is closed to new replies.