Here’s the most straightforward, least detailed guide on what you need to do to create your own custom WordPress theme.
Steps
Very little detail, by design to keep this short and sweet:
- Create a new folder in your
/wp-content/themes/directory, this will be your theme. style.csscontains a specific set of comments at the top to define the name of your theme (and other details). It also can contain the CSS for your theme; it will load automatically.screenshot.pngis what’s shown as a preview underAppearance > Themes.page.phpis the template that’s used for all the Pages you create in WordPress.front-page.phpwill be your homepage after you adjust yourSettings > Readingto use it.post.phpwill be the template used for all the Posts you create.functions.phpis where you add stuff that’s not part of a template.index.phplists your posts and is also the template used if no others exist.header.phpis the global header that starts all templates.footer.phpis the global footer that ends all templates.404.phpis what’s shown for a page not found (404 error).search.phpdisplays search results.archive.phpis a list of filtered posts used for categories, tags, dates, etc.category.phpis likearchive.php, but for listing posts in one category only.tag.phpis the same thing but for posts by tags.
Demo
I’ve set up a basic theme demo of this that’s publicly available on GitHub:
Stylesheet Comment Format
/*
* Theme Name: Basic WP
* Description: Basic custom theme for WordPress that's easy to follow and learn from
* Author: Kevinleary.net
*/
Goals
My ultimate goal here is to provide a very short, easy to follow, no frills guide to setting up your first custom WordPress theme. It’s very beneficial to understand the bare minimum capabilities first. It’s also much less daunting. Hopefully this helps.