The proper way of developing child themes - wordpress

I am going to develop a child theme based on Canvas by WooThemes and I have one simple question: Since a lot can be configured from the theme admin panel, should I use that, rather than pure css in the child theme? For example, if I was to set the body background, should I do it like that, or would it be more recommended to write a single rule of css?

If you can finish everything up in the theme panel, there's no need to write a child theme.
If you have other reasons for writing it, however, keep in mind that options (i.e., everything you do in the admin panel) will not transfer to other sites. Changes you make in the stylesheet will travel with your theme.

Ah you know creating child theme is really good when you want to update your sites time to time.
When you want to make different version of the sites you can make child theme. Do whatever changes in your styles and push to update the theme.

Related

Is it safe to put CSS codes in WordPress customizer?

I put some CSS codes in WordPress Customize Appearance> Customize in my case Additional CSS option, but I don't know if it is safe to put them there or not, since if the theme may get updated I afraid of losing them.
You can add code safely to the customizer area, it's kept in place even when updating the theme. A Child Theme is nevertheless even more recommended due to the more granular control.
Yes, You can add your additional css there. This is meant to be there for the same reason and your code will not be washed out even after updating your theme or plugins or wordpress until you change the theme.

WordPress newbie here - should I be using child or parent themes?

I've just got started on editing WordPress code and have a very basic question.
I've been editing on WordPress all along using plugins and frontend editors. However, I've started to dig into the source code to develop my website further and have thus installed a child theme.
Question is - and I've been searching all over the internet for answers - when I continue to make edits using plugins and frontend editors, should I continue to use the parent theme or child theme? I would think I should use the parent theme - am I right? A child theme is used purely for custom code?
Thank you.
Advantages of Using a WordPress Child Theme
• a child theme will remain untouched when updating WordPress or the parent theme. You will lose all changes made to the parent theme when it gets updated.
• Extend functionality. You can selectively extend the functions you need without touching anything else.
Disadvantages of Using a Child Theme
• Time investment. When you are first starting out with child themes, you need to take the time to learn about WordPress frameworks and their individual filters & hooks.
Child themes also enable folks to customize a parent theme themselves without touching any core files, a practice that safeguards those customization when performing updates to the parent theme. So it is better to use a child theme if there require editing core files.

My first child theme wordpress - color issue

Hi there I've been fiddling with a problem and am hoping for a straight forward answer before I invest a lot of time in customising this theme.
I'm using an EDIN Wordpress theme and I need to change the color and feel of the website. Basically - I want to replace all the #xxxxx color with my own #xxxxx color.
Normally I would grab the Edin theme - CTRL+F the color, and replace it with my own.
However, I learned It's better to create a child theme, and customise from there. The problem is, now i can't CTRL+F the color and replace it with my own and I am using chromes developer tool to figure out where all the colours are located. So I've done a couple, no problem. But it looks like I need to do it for every media query the theme is coded for.
What I'm actually looking for is:
turn all #xxxxx into #xxxxx
Does this exist? If not, whats the best way to go about changing the main color of the theme - which is blue, and found all over the website.
After making a child theme - the CSS stylesheet is completely empty. This is making it difficult for me to find all the parts of the website.
Any help would be greatly appreciated.
Nathan the best thing would be to copy over the stylesheet from the parent theme into your child theme and then make all your changes to that. Your child theme stylesheet will then be used instead of the one in the parent theme. WordPress looks at the child theme first for files, then the parent theme.
If you have the time you could then go and find all your changes and copy them out one by one into a new stylesheet and then use that instead like an override.
The thing to keep in mind is if the parent theme updates... if so then if you are overiding the stylesheet and they make any updates, your child theme will not get those updates. In that case it is worth the time to make the new style sheet containing just your changes.
You would have to change everything manually. Unless there is an implemented option already in the admin panel to change colors etc, not all themes have this option.
The example you gave how to change all the colors at once, it is doable if you are using less. Then you can change same colors or parameters in one place and it will change it everywhere. I would have posted this in the comment section but I don't have enough rep yet.
This is just my opinion, maybe someone will do some research on your theme and will give you a better answer. Cheers

Child theme of child theme

I am developing a website based on child theme, itself based on the framework "Cherry".
I am considering what would be the best way to customize this child theme. I will most likely just have to perform minor modifications like css updates. I am contemplating:
Creating a child theme of the child theme (I tried it, but wordpress told me my child theme was invalid as a parent-theme)
Working on a copy of my child theme (like child theme - dev).
Does anyone know what would be the best solution, or the pro and cons of each ?
It would be better to work on a copy of the child theme since grandchild themes are just a pain. If you're really interested in grandchild themes, here's at least one way that it can be accomplished but in this case you essentially end up writing an a plugin to do handle it.

Where can I add functions to WordPress, not related to the theme?

Here's the situation: There's a WordPress plugin in place that enables a mobile-friendly theme if a mobile User Agent is found (with the usual details and logic, not important).
This mobile theme is copied from the plugin directory, into another, and overwritten when updates to the plugin come out.
I need to provide some extra custom functions for the theme, but don't want to put all of the code directly in the mobile plugin/theme, because it may get overwritten.
I think the best thing might be to put my special/custom functions into their own plugin, and deal with the theme-specific changes as they come up - that way there's less to diff/compare when updates come out.
What do you think is the best approach with something like this? Is there a safe alternative to creating my own plugin, where I can store some custom code?
You could make a wordpress child theme, so that if the parent theme gets updated all your changes remain intact. From the above link:
...the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
That should allow you to do what you need to do.

Categories

Resources