How to Build a Custom WordPress Theme from Scratch

Chirag Dave - Jan 31 '20 - - Dev Community

There are around 12 core files. Here is Overview of the main files you will be working with:
• Header.php – Contains everything you’d want to appear at the top of your site.
• Index.php – The core file that load your theme, also act as the homepage.
• Functions.php – A file that can be used to configure the wordpress core,
Without editing core files.
• Sidebar.php – Contains everything you’d want to appear in sidebar.
• Footer.php – Contains everything you’d want to appear at the bottom of your site.
• Archive.php – The template file used when viewing categories, dates, posts by author,etc.
• Single.php – The template file used when viewing the individual post.
• Comments.php – Called at the bottom of single.php file to enable the comments section.
• Page.php – Similar to single.php
• Search.php – The template file used to search display search results.
• 404.php – The template file that display when a 404 error occurs.
• Style.css – All the styling goes here.

Each of these files contains series of php template tag. By using these tags we can insert dynamic content.

• Configuring the stylesheet
All the details of a WordPress theme are contained within the stylesheet. At the top of your style.css add the following code.

index.php
Open the index.php, add this piece of code and save the file:

Alt Text

The index-file now contains the code that calls to the header, sidebar and footer template files

Alt Text

header.php
Open the header.php, add this piece of code and save the file:

Alt Text

footer.php
Open the footer.php, add this piece of code and save the file:

Alt Text

sidebar.php
Open the sidebar.php, add this piece of code and save the file:

Alt Text

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player