Here is how to code your WordPress theme from scratch. If you have a HTML/CSS template ready and you want to turn it into fully functioning theme then you are at right place. You don’t need to be a very intelligent coder or a software engineer to code your own theme, all you need is little bit of time, patience and a bit of knowledge( which can be gained by just surfing for a few hours.).
Who is this tutorials for :
- Those want to create a theme by themselves for WordPress.
- Those who have basic knowledge of HTML, CSS and PHP.
- Those who need help in coding.
Who isn’t it for:
- Professional coders who is already knowing a lot about this and expecting better stuff here.
- Those who wants to code a next-gen theme which is fully loaded, because this tutorials is for basic learners and only low level stuffs are taught here.
So lets get started…
Here is what are we gonna require first to get started.
- Basic Template
- CSS Styling
and we’re going to convert theme into theme.
As you know WordPress theme doesn’t have to be a single page code. We can break the main page into parts like.
- Index.php . This page is the index page where we will include all the other blocks.
- Sidebar.php This sidebar page, this will hold all the widgets and everything we want to include in side.
- Header.php This is common page for all, it will handle all the heading, page linking, script linking and many things.
- Footer.php this is also common, it will hold everything that you want to include at the bottom of page.
- Content.php This is the page which will print the lists posts for the index.php
- Single.php this is the page which will open when you click to open a single article.
- Comments.php , this page will show the comments.
- Search.php This is the page which will show the search results.
- searchform.php this the page which holds your custom search for( it is not really necessary as there is already a built in search form).
- Tags.php this will show the lists of posts tagged under same tags.
So, understand them. Now we must break our custom theme into parts and start coding.