WordPress

This article explains the basic file structure of WordPress theme . In dummy theme required templates, short codes, custom post type custom taxonomy are included.

This theme can be used to create custom theme. It will just provide the structure to get started.

What does it have?

For creating a theme your theme folder must have two files index.php and style.css.

Index File :
Name : index.php
Location : root folder
Essential for creating theme. It usually have list of default post.

Style File :
Name : style.css
Location : root folder
Styling for theme. It is also an essential file and this file have information about the theme , author its description and license information.

<?php
/*****
 * Theme Name  : Dummy theme
 * Theme URI : https://curiouswebs.in/
 * Author : curiouswebs
 * Author URI : https://curiouswebs.in/about-me
 * Description : This theme has basic template and reqquired files to create a theme.
 * Version: 1.0
 * Tags : Dummy theme, empty theme, basic theme
 * License : GNU General Public License v2 or later
 * License URI : http://www.gnu.org/licenses/gpl-2.0.html
 * 
 * **/

When you include these two files in your theme. Now in admin dashboard visit appearance->themes . you can see your theme and you can activate it. But now you have no menus widgets etc options since you didn’t define them into your theme. So Lets move forward.

Header File
Name : header.php
Location : root folder
this file has start the html , body tag & start of main tag.

Footer File
Name : footer.php
Location : root folder
this file has end of main tag and closing of html tags and also the scripts files.

Functions File
Name : functions.php
Location : root folder
this file is the core file of theme and it has all the action,filter or as name suggests all functions that are important for theme.Apart from this code for menus,shortcode,widgets,image sizes etc. In this file you can include all your styles and scripts.

CSS Folder
Location for all the css files .I just added bootstrap 4 files in this folder. and font awesome 5.

JS Folder
Location for all js files. I added jquery files, bootstrap popper and min js files.

Templates
By default wordpress have template page.php but if you wish to create a custom page template then you can create this. WordPress has template hierarchy. Learn more about this here.
In dummy theme I have included by default
Home Page Template
About Page Template
Contact Page Template
Single Page Template : this is used for post details

Download Link :

Any other file,code or template you want me to include in this folder Please do let me know in comments.

Leave a comment