Child theme of child theme - wordpress

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.

Related

A grand child of a theme

Could you tell me whether several generations of inheritance is possible for WordPress?
A theme
A child theme
A grand child theme
If it is possible, could you tell me how to do that? I have failed.
Why do I need that? Because I use one theme on multiple sites. I have organised a child theme and I modify it constantly, improve it.
But some of the sites may need special functionality. Nevertheless, shese sites should also benefit from general improvements I made.
Please, don't suggest using plugins for modifying the functionality. Plugins depend on hooks, but not everything is possible to do by hooks. A theme is a theme, it can't be substituted by plugins.

Do i keep the child theme or move/use parent theme only? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Not sure its the right place to ask this question,
I have a website that we use mainly for marketing our services, online service bookings and selling bit of products. the site hasn’t been updated since 2017, both the Avada parent and child theme need an update to version 6.2, remove products/WooCommerce and replace the booking system to a new app.
I would like to start managed/update/customise my site but I have no knowledge in coding such as CSS, functions...Etc however I prefer at this point to start with Avada fusion builder as I can easily learn quickly and get results to get my website up and running and then learn coding as I go.
I have installed wordpress on my local ubuntu server using 5.4.1 wordpress/php7.4/apache docker image and MariaDB database Image. i have imported the live site database, content and updates all the plugins and fixed all the small issues.
the site is now up and running on my local server however few things are broken due to the customisation, theme and wordpress version updates. i’m just trying to have a plan what is the best way for me and how to do it.
Before I start update the website, I would like plan how to structure it so it will be easier for me to manage the site in the future. I did some research and it seems that now days for most customisation, you don’t need a child theme as it can do most of CSS customisation and functions by using the WordPress/Avada parent theme and plugin. as explain above the website will have standard pages for the services with style customisation and an online booking system.
The Avada Theme/fusion builder and wordpress has a section to do the custom CSS locally on the page and globally. for the functions codes you can use snippets or similar plugin. if i understand, the customisation are store in the database when you move to a new version of wordpress/theme as well as the plugin store in the content files, meaning when you do your backup you don’t loose it.
if all the customisation are backed up and i don’t need the child theme any more is there a way to copy or use migration plugin to move the customisation from the child theme back to the parent theme? it looks like child theme is not necessary for most websites at it use to be.
My questions are:
Per above scope, future update/upgrades and easy management do I need a child theme or better use parent theme/plugin to do the customisation?
How do I move the child theme configuration back to latest version parent theme?
If keeping the child theme structure, how do I update/migrate/move the old child theme to the new version child theme?
Can i use the old child theme with the new parent theme? or its better/recommended to use the new child theme version.
please check this video, that explain the above, about not using child theme https://youtu.be/30JdAarTAFU
Thank you for your help in advance.
glad to see you actually make an effort to understand this. I will try to answer your questions best I can. I have been working with Avada for last 3 years.
Per above scope, future update/upgrades and easy management do I need
a child theme or better use parent theme/plugin to do the
customisation?
I will always have a child theme. The reason for this is very simple - every site needs to be customised in some way. Yes, page builders help but don't have every option for everything. I use Elementor these days and I believe this is the best builder on the market today, yet I still find myself writing small bits of code to change things that are not supplied with it.
Since you are looking to update your site. You should not remove the child theme because there might be some functions or templates that are used.
How do I move the child theme configuration back to latest version
parent theme?
If there were any custom css you will need to copy it and paste it into the theme 'Custom CSS' option page in the backend of your website.
Any template or functions.php file will need to be moved back to parent theme. However, if you have these files and you moved it back to parent you will overwrite these with any updates to the theme.
I really don't recommend removing child-theme.
If keeping the child theme structure, how do I update/migrate/move the
old child theme to the new version child theme?
You need to update the parent and not the child theme. The whole idea is to never update child theme so none of your files will be overwritten. Also, the core child theme will consist (in most cases) of functions.php and style.css - and both are empty. So if you update the child theme you will be basically removing whats there already.
Can i use the old child theme with the new parent theme? or its
better/recommended to use the new child theme version.
Yes, this is the main reason for having child themes.
Updating Avada
I will assume the version of Avada is 4.0.3 and the newest one is 6.*. The process is very easy:
1. Update WordPress (5.4.1 is the newest today).
2. Download new files from the theme website.
3. Upload the files to parent theme.
4. Login to your admin account on your website. There you should see the installation.
5. Once completed, check all the pages (especially where the builder is present) for any errors.
There might need to make some small changes to the header.php and footer.php
Let me know how it went.

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.

The proper way of developing child themes

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.

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.

Resources