gpspake / grunterie-child

A Child theme for the Grunterie Wordpress theme
MIT License
1 stars 0 forks source link

Child theme not necessary? #4

Open squidzink opened 9 years ago

squidzink commented 9 years ago

@gpspake I was coming back around to consider setting up a child theme for grunterie. However, the other issue here seems to be saying that isn't necessary. Or that you set a child but ONLY put templates in there and leave the grunt work to the parent theme....and that somehow you'll never need to actually update the parent theme?

I'm still pretty clueless how the stuff actually works, but I am continuing to push ahead using SASS. But I just want to make sure that I don't get stuck overwriting stuff later if a new version of grunterie and Foundation happen. Can you help clarify what you meant by you only use a child for templates?

gpspake commented 9 years ago

@squidzink Child themes are absolutely necessary and are highly recommended, but they aren't nearly as complicated as they seem at first. I'd definitely recommend getting a better understanding of them. There are probably a lot of people out there who explain this much better than I will, but a child theme just gives us a place to put any changes we make to the the theme so if the theme gets updated, all of our changes are unaffected. Let's say I want to change how the basic page layout looks... well, I could make the edits in page.php in Grunterie and that would be fine... but later, if I want to update the theme, all of the changes would be overwritten because page.php would be replaced. However, if I copy page.php exactly as-is in to my child theme, it will now override the parent theme's version and we can make our changes there instead. The best part is that when we update the theme, our changes stay in place because we have them all extracted to the child theme. I always use a child theme on every WordPress project because I almost always end up needing to change something in the theme. The only time it might not be useful is if you never expect to make any changes to your theme. For more information about this, check out the child themes entry in the codex

squidzink commented 9 years ago

@gpspake Thanks. I do understand all that, as I used child themes religiously with another theme framework and I've done it with Reverie as a vanilla CSS scenario. What I'm not sure of is how to do it with Grunterie/SASS. I tried loading the child theme but things were broken if I tried to add a functions.php file. I had also tried to target the child theme with grunt. But npm update threw out a ton of errors and failed. You'd mentioned you only used the child for templates. Doesn't that leave your functions and css/scss files in the parent vulnerable?

Questions: What are the minimum files needed in the child theme? Should grunt be run IN the child theme? If not, how is custom sass protected from an update?

I think those are the main questions. The big one really focusing on how the compiling works if grunt is run in the child. If not, are you just cutting and pasting out custom styles from the parent any time you update the parent theme?