Theme Structure

Below are the HTMLy theme structure:

themes/your-theme/
    css/
    img/
    js/
    404.html.php
    404-search.html.php
    layout.html.php
    main.html.php
    no-posts.html.php
    post.html.php
    profile.html.php
    static.html.php

404.html.php

To handle 404 error message.

404-search.html.php

If search doesn't have any result.

layout.html.php

This is the main layout for your theme.

main.html.php

The main content index as a posts list. Eg. in dynamic frontpage, category, tag, archive, or search result.

no-posts.html.php

If we don't have any blog posts.

post.html.php

An individual blog post.

profile.html.php

The profile page.

static.html.php

Template for for static page and sub-static page.

Custom Layout

Sometimes we need custom layout for all of things.

Front page

layout--front.html.php // only layout for front page
static--front.html.php // main content if we use static frontpage
main--front.html.php // main content if we use dynamic frontpage

Blog

This is for /blog url.

layout--blog.html.php
main--blog.html.php

Static page

Example is for /about page

layout--static--about.html.php // only layout for `/about` page
layout--static.html.php // layout for all static page
static--about.html.php // main content for `/about' page

Sub static page

Example this is /about/me page

layout--static--about--me.html.php // only layout for `/about/me` page
layout--static--about.html.php // parent template
static--about--me.html.php // main content for `/about/me' page
static--about.html.php // main content for parent template

Blog post

The blog post only available styling based on category.

layout--post--uncategorized.html.php // layout for all blog post with uncategorized category
layout--post.html.php // layout for all blog post
post--uncategorized.html.php // main content for individual post with uncategorized category.

Category

Example is uncategorized category.

layout--category--uncategorized.html.php
layout--category.html.php
main--category--uncategorized.html.php
main--category.html.php

Tags

Example is post tagged: github.

layout--tag--github.html.php
layout--tag.html.php
main--tag--github.html.php
main--tag.html.php

Archive

layout--archive.html.php
main--archive.html.php

Search

layout--search.html.php
main--search.html.php

Type

Example type image

layout--type.html.php
layout--type--image.html.php
main--type.html.php
main--type--image.html.php