To start building your theme,
first create a sub-folder in the wp-content/themes directory in your WordPress folder. For the purpose of this tutorial, we will call the folder “tutorial_theme”. The name of the folder should correspond to the name of the theme you want to create. To do this you can use either your favorite FTP client or the File Manager tool in your cPanel.
Before you start creating the theme, you should decide how the layout of your website will look like. In this tutorial we will build a WordPress theme that consist of a header, sidebar, content area and a footer.
To do this we will have to create the following files into the tutorial_theme directory:
1. header.php – This file will contain the code for the header section of the theme;
2. index.php – This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included;
3. sidebar.php – This file will contain the information about the sidebar;
4. footer.php – This file will handle your footer;
5. style.css – This file will handle the styling of your new theme;
6. archive.php – The template file used when viewing categories, dates, posts by author, etc.
7. single.php – The template file that’s used when viewing an individual post.
8. comments.php – Called at the bottom of the single.php file to enable the comments section.
9. page.php – Similar to single.php, but used for WordPress pages.
10.search.php – The template file used to display search results.
11.functions.php – A file that can be used to configure the WordPress core, without editing core files.
Each of these files then contains a series of PHP template tags. These tags tell WordPress where to insert the dynamic content. A good example is the tag, which pulls in the post title and displays it in your theme.