Creating a custom theme for your WordPress website is a great way to give your website a unique and personalized look. If you have basic knowledge of HTML, CSS, and PHP, you can easily create your own WordPress theme from scratch. Here’s how:

To create a WordPress theme, you will need to have a basic understanding of HTML, CSS, and PHP. Here are the steps you can follow to create a WordPress theme:
- Create a folder on your computer where you will store your theme files. Name the folder something unique and descriptive, like “my-custom-theme.”
- Create a file called “style.css” and place it inside your theme folder. This file will contain the styles for your theme.
- Create a file called “index.php” and place it inside your theme folder. This file will be the main template for your theme, and it will be used to display the content of your website.
- In the “style.css” file, add the following code at the top:
/*
Theme Name: My Custom Theme
Theme URI: http://example.com/my-custom-theme
Author: Your Name
Author URI: http://example.com
Description: A custom theme for my website.
Version: 1.0
*/
- In the “index.php” file, add the following code at the top:
<?php get_header(); ?>
<div id="main-content">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
the_content();
}
}
?>
</div>
<?php get_footer(); ?>
- Create a folder called “template-parts” inside your theme folder, and then create a file called “header.php” inside the “template-parts” folder. This file will contain the code for the header section of your theme.
- In the “header.php” file, add the following code:
<!DOCTYPE html>
<html>
<head>
<title><?php wp_title(); ?></title>
<?php wp_head(); ?>
</head>
<body>
- Create a file called “footer.php” inside the “template-parts” folder. This file will contain the code for the footer section of your theme.
- In the “footer.php” file, add the following code:
<?php wp_footer(); ?>
</body>
</html>
- Zip the theme folder and upload it to your WordPress website by going to Appearance > Themes > Add New > Upload Theme.
For More Details watch this Youtube video: – Click Here