Create your own WordPress theme from scratch [Part 5]

Well, we have coded index.php, header.php, content.php, sidebar.php, and now the one that is left is footer.php . I don’t know what all to add to footer.php except this code.

If you like to add anything more than this to the footer, then please be free to do so.

Now, if you have activated this test theme already in the wp dashboard. Now, just refresh the homepage. You see that there is only a lengthy plain text. Because, we haven’t yet coded the theme completely.

(It is better if you add demo content to the wordpress


As you can see we haven’t add your blog title to the theme yet. So, we gonna open the header.php again and add this code at the end of the previous code.

The aim of the above code is to echo the blog title and description at the top of the page.

Now, after adding the code to the header.php the total code in header.php must look like this.

Basically, we have completed coding our theme here. We shall now start with the styling, with css code. Start adding css code to the style.css page.

It will make the page perfectly aligned, and fluid. Check it below.

Wordpress theme full page preview.
WordPress theme full page preview.

Now you should start choosing pictures, colors and everything else by yourselves and start adding.

Here completes the creation of WordPress theme. It was totally tested and worked on 2014’s WordPress release.

Create your own WordPress theme from scratch [Part 4]

  • Sikander

    I’m getting issues in running this theme. Coping error messages to you. Please help. Thanks.

    ! ) Parse error: syntax error, unexpected ‘?’ in C:\wamp\www\wordpress\wp-content\themes\testtheme\content.php on line 3
    Call Stack
    # Time Memory Function Location
    1 0.0025 133776 {main}( ) ..\index.php:0
    2 0.0025 135704 require( ‘C:\wamp\www\wordpress\wp-blog-header.php’ ) ..\index.php:17
    3 1.9450 11305072 require_once( ‘C:\wamp\www\wordpress\wp-includes\template-loader.php’ ) ..\wp-blog-header.php:16
    4 2.0125 11525464 include( ‘C:\wamp\www\wordpress\wp-content\themes\testtheme\index.php’ ) ..\template-loader.php:74
    5 2.0975 11546440 get_template_part( ) ..\index.php:5
    6 2.0975 11546880 locate_template( ) ..\general-template.php:179
    7 2.0975 11546984 load_template( ) ..\template.php:477

    • There must be a misplaced ‘?’ in the ‘content.php’ page, please go through code again.