Hey Guys,
In this article, I will explain to you how to create your own theme in WordPress from scratch via coding. If you want to create your theme then read this article. I will show you three simple steps for creating your first theme.
Contents
How To Create Your Own Theme In WordPress Via Coding?
1. Create New Subfolder Inside Theme Folder
After installing WordPress on your local machine open your folder where you installed WordPress. Now go to the themes folder by following this path: wordpress\wp-content\themes. Create a new subfolder and give it a name whatever you want.
For example, I have created a new subfolder named custom theme.
Create Some Necessary Files
Now, all you need to do is create index.php and style.css inside the new subfolder you have created. Basically, WordPress needs only these two files. Open your style.css in your favorite editor and paste the below code inside it.
/* Theme Name: Your Theme Name Theme URI: Your Theme URL Author: Your Name Author URI: Your Site URL Description: Description of Your Theme Version: Version of Your Theme */
Open Your Admin Panel
Now, go to your dashboard and open themes inside appearance. You will see something like this:
And it’s done you have created your first theme. Here you can see that picture is not displayed in our theme like others. If you want to set for your theme then just open your created theme subfolder and paste the picture inside it. Give it the name screenshot.png.
However, if you want to modify your theme and want to give it some style then create header.php, footer.php file. With these files, you can create a header and footer for your website and can make it stylish.