Standard WordPress Themes
After installing the WordPress engine, we will immediately see the start page on which the standard theme will be installed, and the console also has several standard themes, all of which are located in the \ wp-content \ themes \ folder. Yes, they can be used, but not everyone likes them, you should look for something unique, beautiful, new, and more optimized for search engines. Of course, you can use third-party free themes, but if you want to change something, it will be difficult for a beginner to figure out where and what is located, and why so. Therefore, we advise you to create your own theme, then you will have a clear understanding, you will know your theme to the smallest detail and changing it will not be difficult.
Theme folder structure
Any theme must necessarily contain two files, it is index.php and style.css, otherwise the WordPress engine will give us a warning about a damaged topic, so we create two files in the folder with the theme.
Index.php file – The index.php file contains the basic layout of the page. To begin with, the entire layout will be located in this file, and we will transfer the header and footer of the site to a separate file.
Style.css file – This file is responsible for the visual design of the page i.e. what font will be used, color, alignment of blocks, etc., all this will be in style.css.
Creating elementary markup, connecting wp_head and wp_footer hooks
Therefore after creating two index.php and style.css files, we will need to add visual designs because they are empty and not contain any markup and visual design. Let’s create elementary static markup in html5, for this we open the index.php file with any text editor, preferably with code highlighting, for example Sublime Text 3.
Adding styles to style.css
Next, open style.css, and at the very beginning, be sure to add metadata and a description of the theme.
Save and close the file.
We go to the console of our site, open the Appearance -> Themes. If everything was done correctly, then your theme should appear there, if there are any errors, then WP will inform you about them.
Add a picture for the theme
As we see our theme without a picture, it is very easy to fix it, for this, in our case, the folder needs to save a picture with a resolution of 1200px by 900px and the name screenshot.jpg. We refresh the page and see that the picture has appeared.
We created a folder with your theme, got acquainted with the most necessary files for the theme, created the simplest page layout and visual layout, and also connected wp_head and wp_footer hooks. They did the simplest thing, further, it will only be more interesting.