How to Create a Custom Theme in WordPress
WordPress is the most popular CMS and In this tutorial will learn how to create a custom theme in WordPress with step by step guide to create your own custom premium theme.
For creating a basic custom WordPress theme from scratch you must have basic knowledge of HTML, CSS, Javascript, Jquery, PHP. By the end of this step by step development of WordPress Theme tutorial, you will understand how WordPress theme works and how to customize and create your own WordPress theme with ease. So let’s get started with the tutorial.
Prerequisite for Creating Wordpress Theme from Scratch
Before starting with WordPress theme development you must have this software’s installed on your local system or a domain and hosting purchased with WordPress installed on it.
- XAMPP or WAMP Installed locally on your System.
WAMP: acronym for Windows Operating System, Apache (Web server), MySQL Database, and PHP Language. Installing Xampp on your local system is very easy.
1. Download and install WAMP on your computer localhost.
2. Download the latest wordpress.zip from WordPress’s official site.
3. Create a folder under C:\wamp\www name it whatever you want and then extract all the WordPress zip under WordPress folder in C:\wamp\www
4. Start WAMP and Open //localhost/YOUR FOLDER NAME
5. Start auto-install.
XAMPP: acronym for X (any Operating System), Apache (Web server), MySQL Database, PHP Language, and PERL. Installing Xampp on your local system is very easy.
1. Download and install XAMPP on your computer localhost.
2. Start the modules and test your server.
3. Add the WordPress files.
4. Create a database for WordPress.
5. Install WordPress locally via the on-screen installer.
- Domain and Hosting if you wanna work on a Live site.
If you have not purchased domain and hosting and work on your live site. Check out the best domain and hosting providers to get hosting and domain for very cheap.
The Best, Fast, cheap, and reliable web hosting which I personally use is my one and only one favorite “HOSTINGER“. Once you purchase Hosting you will get a free domain along with it
Once all this is done let’s start with custom theme development in WordPress.
“GET FREE DOMAIN & SSL FOR LIFETIME WITH HOSTING”
Article Contents
Step 1: Install WordPress site on Local Server/Hosting Server.
Install a WordPress site on your hosting or local servers such as XAMPP or WAMP so we can test our theme on Live or local server.
Step 2: Download Starter Theme for WordPress.
Stater Theme also known as a ‘blank’ theme – provides a basic structure, files and folders which needs to be modified later for custom development. Similar to WordPress standard themes, they only include very basic structural code on which you can work and create premium themes.
To download the starter theme and install it follow the below steps.
- Visit www.underscores.me
- Enter Name for your Theme and click on download.
- Once Downloaded extract the theme and you will find the basic files and folders
Step 3: Understand the files & folder structure.
Once you downloaded and extracted the starter theme its time for you to customize it and to do that you need to know how WordPress works and theme hierarchy.
Template Important Files List:
- index.php – The main template file of your Theme.
- comments.php – The comments template.
- front-page.php – The front page template.
- home.php – The home page template, which is the front page in wordpress by default. If you use a static front page this is the template for the page with the latest posts.
- single.php – The single post template.
- single-post-type.php – The single post template used when a single post from a custom post type is queried.
- page.php – The page template.
- category.php – The category template.
- tag.php – The tag template.
- taxonomy.php – The term template.
- author.php – The author template.
- archive.php – The archive template.
- search.php – The search results template.
- attachment.php – Attachment template is used when viewing a single attachment.
- image.php – Image attachment template is used when viewing a single image attachment. If not present, attachment.php will be used.
- 404.php – The 404 Not Found template is used when WordPress cannot find a post or page that matches the query.
- style.css – The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme.
- rtl.css – The RTL stylesheet. This will be included automatically if the website’s text direction is right-to-left. This can be generated using the RTLer plugin.
Step 4: Customize the starter Theme.
Customize your theme as per your client requirements. Take advantage of templates, template tags, and the WordPress Loop to generate different website results and looks. Also, learn WordPress Theme Development Standards coding standards.
Step 5: Upload on any WordPress site.
Once you are done with the customization you can upload the theme on any WordPress site to test your own custom developed theme. Also wanna learn step by step with the help of the video then checkout the below tutorial video by freeCodeCamp.org
Complete Video Tutorial to Create a Custom Theme in WordPress from scratch
Conclusion:
So in this way being a developer and knowing HTML, CSS, PHP you can create your own custom theme using the starter theme. Follow theme development documentation provided by WordPress to customize and edit your own theme, also you can list your theme on Wordpress official theme collection.
I hope this article helped you. Do let me know your queries in the comment box. I will be writing more articles to help you out.
Keep Sharing & Keep Visiting!