![]() ![]() Don’t copy the code from the parent theme file because you want it to be separate and customizable. Create another file using your text editor and name it functions.php. Once finished changing the info, make sure to save your changes.ĥ. It lets WordPress know which parent theme your child theme is related to. Adjust the fields as necessary, paying extra attention to the Template line. Using a text editor, create a file called style.css, and populate it with the following code: /*Ĥ. Adjust your file as needed with the proper attributes.ģ. ![]() PLEASE NOTE: In this example, we’re creating a style.css file based on the Twenty Twenty WordPress theme. Make sure you don’t have any spaces in the name, but use hyphens (-) instead. It is recommended that you name it the same as your parent theme, but with -child on the end (e.g. Create a new folder within the theme directory. In either your ftp client or File Manager within your hosting account cPanel, navigate to your themes folder under public_html > wp-content > themes.Ģ. There are a few ways to create a child theme, including manually using an ftp client or file manager, using a WordPress plugin, or with the help of an online child theme generator.įor those of you who prefer video tutorials, here you go.ġ. This means that you get the most out of your customized child theme design without taking anything away from the parent theme’s core functionality. When someone visits your site, WordPress first loads your child theme, then retrieves any missing styles and functions using parts of your parent. You can adjust these items within your child theme even if they are not present in the parent theme. With the style.css and functions.php files, you can alter anything you need to, including: You must have the two files above in your child theme for it to work right. Each has its own style.css and functions.php file, and you can add other files as needed. How do child themes work?Ī WordPress child theme is stored in a directory which is separate from the parent theme. You will need a basic understanding of CSS and HTML to make changes, and some PHP knowledge would also be helpful. Since the files of a child theme are separate from those of a parent theme, you can easily see what you’ve adjusted and undo any unwanted changes. In addition, using a child theme lets you easily track any edits you’ve made. When the parent theme gets updated, your code customizations will not be overwritten, and any changes you’ve made will remain. Why using a WordPress child theme is importantĪ child theme inherits all the characteristics of a parent theme, which makes it easy for you to customize any code while leaving the parent theme’s functionality intact. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |