How to customize the theme.

Estimated reading time: 2 minutes 1,284 views

OVERRIDING PARENT THEME FILES

You can not only target individual style declarations via the style sheet but also override entire components of the parent theme.

For every theme file in the parent directory, WordPress will check whether a corresponding file exists in the child theme, and if so, use that file instead. This means that a header.php A file in the child theme will override its equivalent in the parent folder.

So, if you don’t like something about a page’s layout, just copy the relevant file, make your changes, and upload it to the child theme’s folder. The changes will then appear in the child theme, while the original file will remain unchanged.

WORKING WITH TEMPLATE FILES

We’ve learned that we can overwrite any file in the parent theme by placing a copy in the child theme’s folder and customizing it. However, it’s also possible to use files thatexist only in the child theme. Template files are a good example of this.

Let’s say we want to create a full-width page template for our child theme. Our theme isn’t really suited for a full-screen layout, but let’s do it anyway for demonstration purposes, shall we?

To create a full-width page in Chaoz, you need to create a custom page template. Let’s start with the page template.

For our custom page template, we simply copy page.php from the parent theme, rename it to page-full-width.php and place it in the child theme's root folder.

Share this Doc

How to customize the theme.

Or copy the link

CONTENTS
Belimport

Ask our AI agent how to use, adjust, or install a part on your bike.

You are offline
Chatbot avatar
How can I help you?