WordPress themes aren’t actually all that complicated, but when you first start out as a novice WordPress themes developer, they can be the scariest things on the planet. Ask anyone for advice about custom theme development, and they’ll tell you that you need to learn complex things like HTML and CSS that you’ve previously only seen in your nightmares.
But really, they’re just trying to scare you.
So join us as we take a sneaky peak at the things you need to know about WordPress themes building.
WordPress Themes building Tips
The index file is what controls your homepage.
Just think of it like this: Index = Home.
Ergo, your index file is in charge of what your theme looks like.
single.php is a small file that controls your individual posts. It contains a loop that queries and displays single posts at a time. From here, you can specify whether you want sidebars, and whether you want this post or that post to look different from this post or that post.
This is where things can get slightly confusing for a novice WordPress themes developer; page.php controls what individual pages look like.
Remember, single.php is what controls what individual posts look like.
From this file (page.php), you can control what each page looks like. You can lose sidebars and elements, or add new elements. You also have the freedom to create different page templates for different pages.
If you want to control the look and feel of various archives, head on over to archive.php.
If there is no archive file at all, go to index.php before overriding it with a newly created archive.php file.
When WordPress themes building, you’ll quickly learn that The Loop is the most powerful component. Beginning with a query, it ends with an end while statement. You are in control of everything else. Which is awesome by the way. You get to control post content, metadata, output of titles and so on.
As you’ve probably guessed, comments.php controls your comments section. If you desire, you can override this file with the better connected Disqus plugin.
If you want to use your own custom PHP code to modify the core elements of your template, you need to use the functions.php. As a WordPress themes developer, this file allows you to get super creative.
When WordPress themes building, styles.css is the number 1 CSS stylesheet for your theme. Use it.
If you are a newbie, you might like our list of the best coded WordPress themes.