FULL VIDEO REVIEW:
In this video, we talk about how to create a child theme in WordPress. See below for how to steps.
https://youtu.be/VyZ9hfC9xtg
How To Steps
-
- Open your wp-admin page for the site in question.
- BACK UP YOUR SITE!! See our Updraft Post to see how.
- Click on Plug-In > Add New > Search for: “Child Theme Configurator” > Install > Activate
- On the left side of your wp-admin page > click Tools > Child Themes
- Scroll down on the page until you see the “Child Theme Configurator”
- If you do not already have a child then click on “Create a new Child Theme”
- VERY IMPORTANT: To the left of the Analyze button select the drop-down menu and pick the theme you are working on (usually your active parent theme is the one you want to select)
- Review the warnings/errors and see if they are applicable to you and resolve them as needed.
- We took all the default settings except we DID click on the check box that states “Copy Menu, Widgets, and other Customiser Settings from the Parent Theme to the Child Theme.
- Click on “Create New Child Theme”
- After it is completed it will give you the option to preview the child, do so, and review all the pages and links to verify they are working. Once you are satisfied with it working click on “Activate and Publish”.
- If you forgot to do the last step you can in the wp-admin page > Appearance > Themes > and activate your child theme from there)
- Go back to your wp-admin page > Appearance > Themes and verify your child theme is the one that is active (your parent theme will be there as well but will NOT be the active one currently, the parent theme needs to remain there as the parent theme is the one that will get the UPDATES as they come out and the child theme is derived from there. (In the event things do not work out well you can just go back to your parent theme here and activate it again then you’ll be using your parent theme instead of the child theme you created.
- Go back to your wp-admin page > Appearance > Theme Editor. Since your active theme is currently your child theme it will show you the files that are in that ACTIVE theme folder currently. BE VERY CAREFUL with these files they CAN break your whole site if you mess up anything and you might not be able to get into the wp-admin page either when you mess up these files. So it is EXTREMELY advisable to make a backup of ANY file you are working with OUTSIDE of wp-admin perhaps using FTP or an external text editor, so WHEN you break something you can replace it with a clean file. (Do this part at your OWN RISK as we said it is only a meter of time before you break something when working with these files especially if you do not know what you are doing and willy-nilly mess around with these files.)
SIDE NOTES: When working with Filezilla I found you could not use the DNS name for your FTP server but rather needed to you your exact IP Address in the “host” field. Usually, this is found by doing this: “Go to your hosting provider’s product page. Under Web Hosting, next to the Linux Hosting account you want to use, select Manage. In the account Dashboard, under Settings, select Server (this is usually its own tab). Your IP address appears in the list of settings”.
SIDE NOTE: When creating your FTP account you can usually choose what is the starting folder this account gets access from, if you have multiple sites you can choose the top-level root location and see everything OR you can go down to the site level to exactly where you want to give access. Make your choice carefully and remember to have an EXTREMELY secure password.
IMPORTNAT Troubleshooting
- One thing we like to do is create a separate global_CSS_HTML_JavaScript.php file (you can make one global file or separate them out and use the INCLUDE or REQUIRE keyword in your header.php to call that file.
- We noticed if you try to call that files from functions.php nothing happen.
- We realized it needs to be called from header.php BUT that file was NOT created using the theme builder.
- So create a header.php file in your child theme root directory (the same directory that functions.php lives in)
- Now go up one directory to your PARENT theme this theme is derived from and COPY the entire contents of the header.php file (alternatively you could have copied the whole header.php file to your child theme).
- IMPORTANT either the theme or WordPress in some version must have changed it so that just the fact of including the fine is no longer enough and it doesn’t call your custom global CSS, etc by just including or requiring that file in header.php.
- Edit your custom global_CSS… file so it has a starting and ending tag at the beginning BEFORE your javaScritp, CSS, HTML code and create an OPEN ended php function.
- At the END of your code AFTER the javaScritp, CSS, HTML code put another php open and close tag and inside that tag you are simply closing the function you left open in the above step. Basically, everything is inside your function all.
- Save your file.
- IMPORTANT NOTE: We also noticed WordPress no longer allows inside the folder path of your INCLUDE or REQUIRED statements. It needs it to point the other way as / otherwise in an include it doesn’t get found and in a required it will give you an error that it is not found.
- NOW REMEMBER to call that function you created in global_CSS… inside your header.php right below your INCLUDE or require statement pointing to your global_CSS… > Save your files.
- The rest of the INCLUDES and REQUIRED that are .php related we like to keep in functions.php.
- This information alone likely saved you DAYS and DAYS and DAYS of pulling our hair out please do remember to subscribe, like, ring the notification bell and leave a comment.
- Enjoy.
Conclusion
It is highly advised to create a child theme if you plan to do any work on underlying code/back-end code because if you do that work in your parent theme and at some point update your parent theme your code changes shall likely be overwritten. On that note it is NOT a good idea NOT to keep your parent theme up to date.
*SUBSCRIBE LINK:* SUBSCRIBE NOW
PRODUCT DETAILS
- N/A
Suggestions for the Manufacturer
- N/A
OTHER VIDEOS / Blog Post Recommendations
- N/A
References:
- N/A
IMPORTANT
Thank you for your support please remember to like and subscribe, ring the notification bell and leave a comment!!
*SUBSCRIBE LINK:* SUBSCRIBE NOW
- Privacy Policy
- Disclaimer
- Affiliate Disclaimer