Basic WordPress Theme Structure

Written by | Posted on March 30th, 2018
Basic WordPress Theme Structure

Today I will show you the Basic WordPress Theme Structure and so that you can easily create a WordPress template from the scratch.

4.5% of the internet run by WordPress Content Management System (CMS) followed by Joomla, Drupal. WordPress was the king of all Content Management System (CMS) all blogging platform worldwide run’s by WordPress no wonder it is the most popular CMS of them all.

WordPress is the easiest and extremely customizable platform template compared to other CMS like Joomla and Drupal and easy to set up to your web server’s the file structure are easy to manage and customizable user interface. If you have a  knowledge of programming and coding in PHP, HTML/CSS it was a lot easier to customize your own WordPress Theme and advantage to create your own template design.

Inside your WordPress root directory, there are a folder name themes C:\xampp\htdocs\\wp-content\themes\MarjunTheme each folder in this path has a unique subdirectory.

Basic File Structure

There are two file structure for basic fundamental of WordPress theme which is the main file to read if you open the website

  • index.php
  • style.css

index.php is must be present in the first or template folder in your directory root it is the main page to display by all pages on the website.

Take a look my index.php sample


style.css is consist of all CSS code in your template this is the main stylesheet of your themes and must include in your main themes directory folder and it should place inside your head tag <head>.

style.css file must contain information about your theme and provide details about the ownership of the theme in the form of comments before the actual CSS codes. If you creating your own theme make sure that you put your ownership or author information inside the comments before the actual CSS codes below.

The following is my example stylesheet code that I’m using to my website template

This is the template files include

  • header.php
  • comments.php
  • single.php
  • page.php
  • footer.php
  • sidebar.php

These files can include into your index.php file within the same path directory in your theme folder C:\xampp\htdocs\\wp-content\themes\MarjunTheme.

Inside your index.php you can include those files with this GET function

  • get_header()
  • get_comments()
  • get_single()
  • get_page()
  • get_footer()
  • get_sidebar()

Here is the example include code inside your index.php


So that’s it I hope it can help you with your WordPress theme customization or if you want to create your own WordPress Template, this is  Basic WordPress Theme Structure only if you want the full complete list and advanced just CLICK HERE.

Happy Coding 🙂