WordPress theme creation

by Dawid Adach,

Final result preview
Live preview

So here we are, ready to develop our first WordPress theme. In this tutorial, we will create the most common theme - blog template.

1. Placeholder

Let's create a folder to store our template. Navigate to the folder where your WordPress is installed (if you haven't done that yet follow this tutorial). Navigate to wp-content/themes, you should see 3 default themes (twentyfifteen, twentyfourteen, twentysixteen). Create a new folder and call it mdbblog.

2. Creating style.css

Create style.css file (you can use any text editor, I use Sublime 3) and paste the following code into it:

Theme Name: MDB Blog
Theme URI: https://mdbootstrap.com 
Description: This is outstanding WP Blog theme developed on Material Design for Bootstrap 4
Version: 1
Author: MDBootstrap.com
Author URI: https://mdbootstrap.com

3. Creating index.php

Create index.php file and paste the following code into it:

<h1>One day I will be a writer!</h1>

Congratulations! You've just created your first theme. Perhaps it isn't the most beautiful nor useful theme you have ever seen, but we will take care of it soon. Let's activate it. Open your admin dashboard, go to Appearance in the left menu, and then click Themes.

You should see your new Theme (MDB Blog) on the list.

WordPress themes list

Click Activate button, and navigate to the home page.

If you see text "One day, I will be a writer!", it means that you have succeeded in creating your first theme.

Lesson summary

In order to create WordPress theme you have to create at least 2 files: index.php and style.css.

If something doesn’t work as expected, you can download a final code for this lesson here:

Previous Tutorial Download Live preview Next lesson

Do you want to share?

Facebook Twitter Google +

About author

Dawid Adach

For more than 5 years Dawid was working as an IT Consultant specializing in SOA/EAI/ESB for banking domain. He was gaining experience working in countries like Netherlands, Belgium, Poland and India developing enterprise-class systems for the biggest companies within a domain. Since 2 years as a co-founder of mdbootstrap.com & brandflow.net is using and teaching others technologies like Angular, TypeScript, PHP, AJAX, Mongo, SQL, Hadoop Stack, Virtualization, Automation and many others...

Comments 12

Leave a reply

Join MDB Affiliate Program

Get 30% profit from each sale

You earn 30% commission on affiliate sales, when a product is bought by a customer you referred, you will receive a 30% share.

Join us