Create a WordPress Theme

Create a WordPress ThemeIn this tutorial I’ll show you how to Create a WordPress Theme from scratch. I made all of the HTML and CSS code in this video tutorial How to Layout a Website.

You should definitely watch that tutorial before you try this one unless you are very experienced using HTML and CSS.

The theme is available in this zipped archive. This is a newer version of this theme. Everything is available under the GNU License.

After the video I provide all of the code used in the entire tutorial. Leave any questions below and if you find this theme useful feel free to share it [nttfblike]

If you like videos like this, tell Google [googleplusone] I really appreciate it 🙂

Code From the Video

Here are all of the files needed for a WordPress theme. Click on the link to see that code.

404.php

archive.php

comments.php

footer.php

functions.php

header.php

index.php

meta.php

nav.php

page.php

search.php

searchform.php

sidebar-first.php

sidebar-second.php

single.php

style.css

74 thoughts on “Create a WordPress Theme”

  1. thank you very mutch for all your tutorials derek
    a ctually i’m watching your php tutorials. all amazing like this one.
    your last title Every Article helped to better navigate in your wevsite so now now i spend more time on it.

    you’ve always been excelent. awesome

  2. Hi there,

    First off all i realy like your vieo tuturials a lot.
    Im building my own wordpress time right now whit the help of this Tuturials.

    But im stuck a little.

    To show my post i used your code.
    Like this one.

    $wp_query->query(‘posts_per_page=6&category_name=Blog’);

    But actualy i want to show all post except the post from the catagory Video.
    Can you plz help me out, i cant find how to change the code to let it work.

    Thnx a lot.

    1. Here is your answer! If you want to Exclude Posts Belonging to Category prefixing its id with a ‘-‘ (minus) sign.

      $query = new WP_Query( ‘cat=-12,-34,-56’ ); This excludes those posts in category 12, 34 and 56

      Hope that helps

      1. I know, i’ve almost seen them all.
        They help a lot.

        But maby there is one little issue you can help me with.

        When i come on my single page of a post and i have a image in that post. How do i delete the link on the image from the content.

        I don’t want that poeple be linkt to the original image.

        I hope you understand what i mean, because my englisch is not to good because im dutch.

          1. Yes thats what i mean, i want to delete the a href of the image in the content on the single page. There is the php for the content that gets the image and al of the text but the image is a link to the original i want to delete that link so they cant click the image at all

            1. There is no way to keep people from getting your image. You could create stumbling blocks, but a screen grab is impossible to stop. The only way to keep people from using your images is to copyright them

  3. For getting the article information, how would the php code be if I am trying to pull the latest posts not specified by the categories? What I am refering is the lines 10 – 22 of index.php. Let’s say I am trying to get the recent 8 posts (in two columns (2×4) regardless of their categories and I have more than 2 categories, how would the code be like?

    Anyways, thanks for the great tutorials 🙂

  4. I’m having a problem WordPress is telling me Broken

    Themes

    The following themes are installed but incomplete. Themes must have a stylesheet and a template.
    Name Description
    RedBox/style.css File not readable.

    I’m not sure whats it is wanting.. I tried writing my own it didn’t work so I copied and paste yours and it still is saying that.

      1. I found out what it was my permissions were turned off. Thank you for your help.. I’m just starting coding and all your videos are a big help.. I watch a lot of other ones and your by far the easiest and best for the help..

        Once I get up and running I would like to make an ad for your Website on all my sites.

        1. So now that I have it to be able to preview or activate, when I click on preview it comes up as a blank screen nothing but white.

        2. Thank you. I’m glad you like the videos. Creating WordPress themes is pretty advanced. Very few people know how to do that. Keep at it

  5. is there any way that I could send you my CSS coding.. My dumb menu wont change, to what it should look like.

    1. I’m sorry, but I can’t correct large blocks of code. I just don’t have time to do that as well as continue to make tutorials.

  6. I have this code right after the HorcontentRule just like you did in the Index.php folder.

    p class=”contentExcerpt”>post_excerpt; echo substr($ntt_the_excerpt, 0, 157); ?> <a href="” class=”clickForMore”>More</p
    I did discard the at the beginning and end of the code.

    but I can’t get my text to show up. I copy and pasted your code and it still didn’t work, what could be the issue.

      1. When I put in ?php the_content();? it brings all the content but when I put in ?php $the_content = $post->post_content; echo substr($the_content, 0, 200); ? nothing comes up… I just want like part of it to come not all of it and not none of it.. anything you can think of?

  7. One thing I thought I should say to help is that it works for my Title. the code for my excerpt isn’t working in my sidebar either and all the Articles on my sidebar have over 200 words.

  8. Great tutorial. I have two questions..

    My drop down menu items work fine in firefox/safari but do not work in IE.. is there a fix somewhere i can use?

    Also, is there anyway to set the drop down items side to side rather then on top of each other?

    Thanks!

  9. Hi admin,

    You are really a brilliant teacher.. the way you taught is really easy to understand, thanks for such helpful tutorials, I request you to add some more tutorials about wordpress designing and coding..

    Best wishesBes:amir

  10. you are great!
    great explanations. everything is big and clear.
    you even interact with the viewer, calming him down.
    great!
    all the best to you and thank you very much!

  11. Hi,
    I’ve downloaded the theme and activated it. an error is showing on the top of my dashboard: “Notice: automatic_feed_links is deprecated since version 3.0! Use add_theme_support( ‘automatic-feed-links’ ) instead”.

    there is another error showing on my site: “Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.)”.

    both printed by: \wp-includes\functions.php

    what should I do?

    many thanks to you.

    1. Search for automatic_feed_links(); in function.php and replace it with add_theme_support('automatic-feed-links');

      To get rid of the second error replace wp_enqueue_script('jquery'); with
      function thematic_enqueue_scripts() {
      wp_enqueue_script('jquery');
      }
      add_action('wp_enqueue_scripts', 'thematic_enqueue_scripts');

      That should fix it

      1. the first error is gone, thank you!

        the second one is still bugging us. just in case, here is the code for functions.php:

        <?php

        // Add RSS links to section
        add_theme_support('automatic-feed-links');

        // Load jQuery
        function thematic_enqueue_scripts() {
        wp_enqueue_script('jquery');
        }
        if ( !is_admin() ) {
        wp_deregister_script('jquery');
        wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"), false);
        add_action('wp_enqueue_scripts', 'thematic_enqueue_scripts');
        }

        // Clean up the
        ...

  12. I appreciate, lead to I found just what I used to be taking a
    look for. You have ended my four day lengthy hunt! God
    Bless you man. Have a nice day. Bye

  13. Hi Derek,

    I like the series of your tutorial, it is not boring and very energetic. Thank you, by the way,

    What is the best tutorial about the responsive website using wordpress?

    Thanks and have a great day!!

  14. The problem is that only one box each for the articles and the videos show up and there appear to be in the first sidebar. They also don’t have anything in them, just the title and container.

    Do I need to do something with the dashboard to make this work? I’m very new to WP; where do the article and videos come from?

    Any help would be greatly appreciated.

    P.S. I really like you edited style; I like not having to listen to someone umming and ahhing.

  15. Hi Derek, I’m really enjoying your tutorials; thanks a lot for putting them up.

    I’m having trouble getting the middle container to work (the Articles and the Videos.) I thought at first it was my coding but I used your NTT-Cindy-Theme straight from the zipped file on your website and got the same problem.

    The problem is that only one box each for the articles and the videos show up and there appear to be in the first sidebar. They also don’t have anything in them, just the title and container.

    Do I need to do something with the dashboard to make this work? I’m very new to WP; where do the article and videos come from?

    Any help would be greatly appreciated.

    P.S. I really like you edited style; I like not having to listen to someone umming and ahhing.

    1. Hi Derek

      I’ve managed to work out that I didn’t have any articles or video; or the categories for them (told you I was new to WP.) I figured this out watching the next video.

      I’m still having trouble with the menu system, it’s just showing up as a normal list with bullet points.

      1. I’m glad you got it working. For the menu to work, make sure that you define your menu under appearances in the WP dashboard. I bet you that is the problem

  16. hi there! im in LOVE with your tuts!!! very clear and presented in a way that my brain just gets! THANK YOU!!! However, I was wondering where the “blank theme” is for download? I’m not seeing it aywhere?

    Thanks!!!

Leave a Reply

Your email address will not be published. Required fields are marked *