Minimal Files Required To Create New WordPress Theme

WordPress covers about 26% of the website till launched now and it seems that you are the WordPress theme developer, we came to know that, since you are searching about creating new WordPress theme and accidentally landed here. Well, you are in luck with it. We will describe about creating new WordPress theme with the minimal requirement of files to built it.

While developing theme for WordPress, it has almost many files associated with if, if you look towards any of the theme code existing in the WordPress theme repository. But, are all of them required? No, all of those files are not required to build the WordPress theme. So, here we will be pointing out the minimum required files for creating the WordPress theme.

Well, for creating a new WordPress theme, you require some of the files to be present in the file system inside the themes directory of the WordPress install, ie, inside the /wp-content/themes/ folder. Those main files are mainly style.css and index.php, which again needs to be inside the folder too, ie, inside the newly created folder to build the WordPress theme. If any of them is absent, then, the created WordPress theme does not work at all. Hence, here we will provide you the basic and the minimal codes required to build a new WordPress theme from scratch. They are given below:

Create a file named as style.css

WordPress detects the available theme only if there is the presence of this file, not only that, it also requires the proper documentation to detect that it is the WordPress theme or not. The required documentation to be present in this file is given as:

The above documentation is the minimal required and recommended code to be present in the style.css file of your built WordPress theme. The description for the above code is as below:

  1. Theme Name: Name to be given to the theme to be created
  2. Theme URI: The url of the theme, ie, the link must contain the information about the theme if it is provided
  3. Author: The name of the theme author
  4. Author URI: The link to the theme author, if it is present, then, the link should point to the project work done or should be your personal site
  5. Description: The description of the theme, ie, what the theme is about
  6. Version: The version number of the theme

Create a file named as index.php

The next important file to build new WordPress theme is index.php. Without this file in your theme, style.css file is of no use. So, both of them must be present. The required codes in index.php file to display the content of posts as well as sidebar areas is as below:

new-wordpress-theme

The above image shows the newly created WordPress theme in the WordPress theme directory present in your WordPress install, after applying the provided above code in your theme’s file.

showing-the-output-of-the-new-wordpress-theme

Similarly, the above image shows the output of the newly created WordPress theme, as described above. Here, you can see that the header information, post content, sidebar content as well as footer areas is displayed properly.

Conclusion

Hope, now, after you have read the above tutorial and follow up, you know the basic and the required minimal codes for creating the new WordPress theme from scratch and now can develop it being more confident.

, , , , , , , , , , , , , , , , , , , , , , ,

Post navigation

Bishal Napit

Bishal Napit is a WordPress theme developer from Tansen, Palpa, with a passion to learn more on WordPress.

Leave a Reply