|How-to||– 11 min read –||October 18, 2019|
How to independently create a WordPress theme
Why create a WordPress template from scratch
Advantages of creating a new theme
- An ability to differ from competitors using standard WordPress templates;
- an ability to use unique functions, independently select working items;
- when working manually you can save money on involving third-party specialists;
- using different designs for each website page;
- an opportunity to refine or adjust the theme;
- creating a child theme as a backup to roll back unnecessary changes.
How to create a theme for WordPress
Next, you need to find the wp-content\themes directory on the disk where WordPress is installed and create a new folder in it with the name of the future theme. It also stores standard WordPress templates.
Each theme necessarily contains two files: index.php and style.css as well as an images folder with images for the template. To get started, just create these files, and then start filling them in. The index.php file can be registered independently in a text editor, ordered from a specialist, or taken with the ready-made content from another theme.
For the template, you need to upload the screenshot.png file with the desired extension of 1200x900 pixels to the folder with the theme. This can be any image that fits the specified format.
Let's consider an example of the index.php file with simple content for a theme with a header, footer, main post, and sidebar.
Now you need to fill in the style.css file. Like at the previous step, open a text editor and add the following content:
Division of index.php into separate files
In order for the header, sidebar, and footer to display correctly, you need to link their individual files with the main (index). To do this, add the line at the beginning of the index.php file:
Why create a child WordPress theme
Creating a child WordPress theme starts just like getting started with the main one. You need to open the wp-content\themes directory and create a folder for the second theme in it. Next, do the same as before: create index.php and style.css files. In the second one, write:
Builders and services for creating WordPress themes
One of the popular theme generators is Lubith which has a very simple and intuitive interface. To master this tool, it will suffice if you can read in English.
After registration, a personal account with settings opens. In this window, you can create and install blocks, select colors and the exact frame size. Use the sections on the left side of the monitor to select settings:
There are alternative WordPress theme builders with intuitive interfaces: Beaver Builder, Page Builder, Elementor.
Each WordPress template is based on two files: index.php and style.css. After they are created, you can experiment with different elements and functions of the templates, create a unique design for each page.
If there is no opportunity or desire to independently create a theme, use special online WordPress theme builders.
Learn how to get the most out of Serpstat
Want to get a personal demo, trial period or bunch of successful use cases?
Send a request and our expert will contact you ;)
Cases, lifehacks, researches and useful articles
Don’t you have time to follow the news? No worries!
Our editor Stacy will choose articles that will definitely help you with your work. Join our cozy community :)