Each site element is a separate file uploaded to the server. The site files tell the browser how to display the information on the user’s screen. And when a user visits a page on your site, WordPress loads the appropriate templates (files) based on the request.
The theme contains two main files:
index.php – the main theme file, which is responsible for displaying the page content;
style.css – the main styles file. All .css files are responsible for the appearance of the elements of the future site: their size, color, etc.
Any site can be visually divided into blocks. For each block will be responsible for a specific file within the theme. Consider the main elements of the page:
- Header (header) is located at the top of the page. File header.php is responsible for the output of the header.
- Footer (footer) is at the bottom of the page. For output footer file footer.php.
- Side parts (widgets). For their output is responsible file sidebar.php.
In addition to the main elements can be dozens of others. It all depends on the requirements for the site. If you need a block with comments, it will use the file comments.php, if the page will be located posts, the file single.php. There are many variations of PHP-files.
Thus, the theme in WordPress is responsible for how the site will look to the visitor. To add additional functionality to the site (polls, forums, search engine optimization) use WordPress plugins.
Subsidiary Theme
A child theme in WordPress is an additional theme that inherits the look and full functionality of the parent (original) theme. You can make changes to the visual design and functionality of a child theme, and the parent theme will remain intact. And vice versa, if the developer makes changes to the parent theme, the settings of the child theme will remain unchanged.
The child theme of WordPress works at the file level. When some file is required to load a theme, WordPress checks to see if the desired file is in the child theme. If there is, it uses the contents of that file, if not, it downloads the file from the parent theme. The process of creating a child theme requires knowledge and skills to create a site without the help of a CMS. A simple way to create a child theme is to use the Child Theme Configurator plugin. It is enough to insert a link to the parent theme, and the plugin itself will help set everything up.
Advantages of child themes:
Saves your settings. Using a child theme, you can make changes right in the code without fear of losing your settings when you update the parent theme.
A child WordPress theme can improve your workflow. Using just one theme, you can create sites with different functionality for multiple clients.