Start learning with our library of video tutorials taught by experts. Get started

WordPress 3: Creating and Editing Custom Themes

Building a home page mockup


From:

WordPress 3: Creating and Editing Custom Themes

with Chris Coyier
Expand all | Collapse all
  1. 6m 44s
    1. Welcome
      1m 19s
    2. Using the exercise files
      5m 25s
  2. 40m 42s
    1. Reviewing the client spec and deciding on WordPress
      6m 50s
    2. Reviewing assets and resources and creating a mood board
      8m 41s
    3. Building a home page mockup
      11m 26s
    4. Finishing the home page
      12m 27s
    5. Planning the rest of the site
      1m 18s
  3. 1h 8m
    1. Starting with a base project
      3m 6s
    2. Writing HTML code for the home page
      12m 7s
    3. Starting the CSS: Creating the header and basic style structure
      11m 28s
    4. Styling the Navigation panel
      10m 59s
    5. Styling the sidebar
      7m 55s
    6. Styling the home page, pt. 1
      8m 20s
    7. Styling the home page, pt. 2
      8m 17s
    8. Finishing the CSS
      3m 14s
    9. Moving on: One page is enough
      2m 43s
  4. 1h 56m
    1. Setting up WordPress and MAMP on a Mac
      6m 7s
    2. Setting up WordPress and WAMP on a Windows computer
      5m 38s
    3. Modifying important settings
      6m 26s
    4. Starting with a blank theme template
      4m 35s
    5. Introducing template file structure
      4m 55s
    6. Breaking up the HTML
      9m 53s
    7. Building the sidebar
      3m 54s
    8. Building the navigation
      7m 20s
    9. Showing one recent post
      4m 1s
    10. Fetching external content
      8m 23s
    11. Creating a custom home page
      3m 30s
    12. Introducing custom fields
      5m 23s
    13. Creating custom product pages
      9m 52s
    14. Creating custom category pages
      15m 39s
    15. Creating the blog home page
      5m 39s
    16. Creating a single blog entry page
      4m 15s
    17. Implementing comments
      5m 57s
    18. Finishing the home page
      4m 45s
  5. 34m 17s
    1. Will this work with WordPress?
      3m 10s
    2. Using JavaScript in themes the right way
      8m 35s
    3. Implementing something fun with JavaScript
      7m 53s
    4. Introducing plug-ins
      6m 31s
    5. Setting up security
      8m 8s
  6. 2m 7s
    1. Goodbye
      2m 7s

Video: Building a home page mockup

Now it's time to start creating the actual design of the site in Photoshop. If you don't have any interest in working in Photoshop, or this part of the workflow, the finished Photoshop file is available in the exercise files. If you don't have access to those, it's also free exercise file available on the course page. Then you can continue with this course in Chapter 2. We are going to be working in the homepage design. The homepage is just as good of a place to start as any, but you wouldn't necessarily have to. If you have particular inspiration to start with a different area of your site, by all means go for it.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
WordPress 3: Creating and Editing Custom Themes
4h 28m Intermediate Nov 03, 2010

Viewers: in countries Watching now:

In WordPress 3: Creating and Editing Custom Themes, author Chris Coyier shows how to build a custom WordPress theme from scratch and satisfy common client requests. The course covers steps necessary to build a theme using a complete workflow with Photoshop, HTML, CSS, and WordPress 3.0. Also included are tutorials on enhancing a WordPress site with JavaScript, using plugins, and ensuring site security. Exercise files accompany the course.

Topics include:
  • Building a design in Photoshop
  • Converting Photoshop design to HTML and CSS
  • Setting up MAMP on Mac and WAMP on Windows
  • Moving HTML and CSS into a WordPress theme
  • Building navigation
  • Using custom fields
  • Creating a commenting system
  • Using JavaScript and plugins
Subjects:
Developer Web CMS
Software:
WordPress
Author:
Chris Coyier

Building a home page mockup

Now it's time to start creating the actual design of the site in Photoshop. If you don't have any interest in working in Photoshop, or this part of the workflow, the finished Photoshop file is available in the exercise files. If you don't have access to those, it's also free exercise file available on the course page. Then you can continue with this course in Chapter 2. We are going to be working in the homepage design. The homepage is just as good of a place to start as any, but you wouldn't necessarily have to. If you have particular inspiration to start with a different area of your site, by all means go for it.

Now we have this mood board created. It just has some typography styles and some color choices,and some things we are playing with to kind of set the mood for what the design is going to be like. So I have that open here. We'll be using that potentially a bit, but we are going to need a new document for the actual design. So I will create a new document. I am going to create it at 800x1200 pixels, width and height respectively there. Now there are no major theories at work here. It's just what we are going to go with now. If we find out as we are laying stuff out, these things need to be adjusted, we can absolutely do that.

That's the part of the beauty of working digitally. Now double-click the background layer. That's just going to unlock it, and then I am going to go to Image > Canvas Size, and make the width maybe 1200x1400, something like that. Now that's going to put our white background from our original document just perfectly centered in this document, just so that we have, this is going to be representative of our content area, and then we'll have some background area to play with as well.

So I make a new layer in the Layers palette by clicking on this little page icon down here. Drag this layer beneath the Content layer. I'll name it as we go here, so Content. Then I am going to fill this layer just by pressing Command+Delete. It's going to make it white, so we have some white on white going on there. Maybe we'll fill it instead with a gray color. We'll pick some dark gray. So I am going to hit Option+Delete then to fill it with our foreground color.

Remember I am trying to replicate this noise thing going on. So that's looking a little dark. Maybe we should try and mimic this exactly. I am going to go ahead and click the Eyedropper tool, and then sample a gray from over there. So now our foreground color is this gray. Hit Option+Delete to fill with that color grey. Now that's closer to what we are happy with, with our mood board. Then I'll fill it with noise as we did before. So Filter > Noise > Add Noise. This gives us an example of what that noise might look like. It looks like it saved that setting from when we are playing with the mood board.

So that level of noise is pretty nice. You can't see it when I am zoomed out here, but if I press Command+1 to look at this document at full size, you can see the noise on the outside here. The content area is a little far from the top. Maybe I'll grab my black arrow tool here and drag it up a little higher. Let's get that logo over here. I am in our mood board. I am going to grab the layer that is our logo, and drag it over into our new document. Now it's kind of big looking, but that might be good.

It might be cool for this site. Now remember I feel like this logo works cool on dark and light. It actually works cool breaking the boundaries of this white a bit. So I mean, we could tuck it in here, that might be a traditional look for a logo, but I don't see any reason not to break the mold a little bit and offset it on this content area. That looks kind of neat. And we have these one pixel lines going on. Maybe I can draw a line like that. This is kind of working for me as a header area. So grab the Line tool. Maybe make a line separating a header area.

Now we should move that underneath the logo. So it doesn't cut into the logo, and we'll grab that typography from Widget Corp. We'll drag that in. Now maybe this logo is a little big. So I am picturing if we start being smart with our grid here, and I'll just press Command+R to open up our rulers on the edges of this document, we can start dragging guides in, and I'm picturing if we put a guide there, that makes sense to start having content down here that lines up nicely with that, and maybe this would be a nice sidebar area.

This is pretty big for a sidebar area. It's not even like one-third, two-thirds. It's more dramatic than that. I am hoping our sidebar is a little more toned back something like that. So maybe we should make that logo bit smaller to accommodate. I pressed Command+T to get the resizing ability here. I am going to hold Shift as I resize. Maybe make it something like that. Bring Widget Corp over, another guide. But we are not working with a grid layout in that this is a 12 column grid or anything like that, but we are working with the grid in that we are going to be dragging in guides to make sure that what we do kind of make sense.

Now I get this feeling from this. It almost looks like letterhead, which is kind of neat, and that works with our idea that these mail marks that we found, remember back in the exercise files here from the previous movie, there is these assets. This is what they gave us, and then under the idea folder there is this mailmarks.jpg, which are these files, scans from mail images from iStockphoto. We could use some of that to work with this letterhead type of look, and in our mood Board, we have some of these marks already.

I am going to go ahead and find the postmark looking one up here, drag that over, maybe stick it up in the upper right corner here, and that's pretty bold, but I can tone it down with Opacity right on this layer. No problem! You see how it sticks out above the background? That's a little awkward. So I am going to Command+Click the Content layer, which is going to make that box the active selection, and then click onto this, which is our Mail Mark. I will name it that, Mail Mark, so we can find it easily again in the future.

And with this selection going, I'll click this little icon at the bottom of our Layers palette. It's going to give it a layer mask, so it's going to cut that at the edges there. It doesn't bleed over the top. That's kind of neat. We can move along with our sidebar a bit. Navigation, of course, is a super important part of any site and the part of the goals that we establish for this site is they want to have it be able to like, be easy to contact the company, find out more information about the company, feature their widgets.

So part of those goals are going to be what forms our navigation and a sidebar looks like it's going to be a good place to do that. Now we have some colors going here, some color bars, and I am thinking even though we weren't necessarily thinking about design structure with these bars, that they kind of help work in that way. Let's just go ahead and drag those over here. I mean that's humongous and weird, but maybe we can take a portion of those. Let's just perhaps just kind of lay it here and then we'll cut a selection from the edge to that first guide and then make another layer mask, and then maybe just those bits of that bar can work as a navigation.

That's kind of neat. So our widget is the only real like three-dimensional element we have here. We have a bit of a drop shadow on the typography of the name of the corporation that raises it up, but everything is like coming at us, three-dimensionally, and maybe it would be kind of neat if we move backward a little bit too, for some, just to ground it a bit. I am going to duplicate this layer that we have gone from navigation. So now I have two copies of them, as you can see. Now I'll move it over a bit. I am going to get rid of the layer mask, which is this part of the layer you can see.

I am going to just drag that to the Trash and it's going to ask me,if I want to apply it before removing. That's fine, we can do that. Then I am going to shrink it down a little bit so it's just this little nub sticking off to the left. If I turn off the layer you can see the nub goes away. I'll leave it on and kind of nudge it downwards maybe, so it kind of has this offset, and maybe we will cast a shadow from our document on this so it kind of gives a better three-dimensional look. I am going to move these little nubs below the content area and then I am going to double-click the content area layer. I am just going to open the Layer Style palette, where I can give it the Content area a drop shadow.

So we are working with this big white box, our whole content area. If I take the distance all the way down to zero and bring up the size a little bit, it puts this drop shadow around that box. I can tone it down a little bit. We'll see it gives that dimensionality to this. So that's kind of neat. It looks like it's kind of a ribbon that's hanging off the edge of it. It's a simple design effect. Maybe that will work. Now this is going to be navigation literally. So we need to think, I mean we are in this design stage, we should think, what is the navigation exactly? I know they want to feature their widgets, so maybe our widgets, and let's pick a color that's going to work with all of these different colors. A neutral like white should be fine, because they are dark enough.

So I just typed Our Widgets, which is this layer, but now we are too low in the Layer palette. I am going to drag it up above that so we can see the text, and drag it over. Now I am not sure about that. We have Helvetica going on up here, kind of a web safe font for the most part, later in the CSS we'll be dealing with fallbacks and all that, but let's go with something even safer for our navigation. Like probably a font like Georgia. And that's a little big. I am going to open our Character palette here and make it smaller.

Make it not all caps. I am going to duplicate that layer. I can do that just by hitting Command+J, just drag the duplicate layer down, and I'll say maybe About Us, duplicate that one, drag it down, Contact Us, and their blog of course, and maybe the blog should have some personality. I mean, we could just say Blog, but blog is such a kind of gross word, isn't it sometimes? Maybe we should call it The Grind. Then we could say like our blog, so people have some idea what the about, but it doesn't just say blog. I'll make that maybe italic and a bit smaller.

Okay, so the navigation is working. I can picture that being pretty obvious how that will work. It should be fine. What we have done here is a great start on the structure of the homepage and actually probably most of the pages on the site. We'll continue fleshing out the content of the homepage in the next movie.

Find answers to the most frequently asked questions about WordPress 3: Creating and Editing Custom Themes.


Expand all | Collapse all
Please wait...
Q: What prerequisite skill do I need to be successful in this course?
A: This course is set at the intermediate/advanced level. You’ll do best if you have a good knowledge of Photoshop, plus a good grasp of PHPHTML, and CSS.

Q: The index.php file that the author is working with in Chapter 3 doesn't match mine after the "Building a sidebar" movie. It appears to change between the "Building a sidebar" and "Building the navigation" movies. What code am I missing?
A: The author makes some changes off screen between several movies in this title, simply because there is so much material to cover. These changes are provided in the exercise files.

However, if you are following along without the exercise files, you catch up to him by adding the following code to your index.php file, directly after the <?php get_header(); ?> line:

<div id="main-content">

Near the end of the file, just before  <?php get_sidebar(); ?>, add a closing div tag, </div>, to complete the div wrapper.

The resulting code will look like so. You may also copy and paste this into a new file and save it as index.php.

<?php get_header(); ?>

<div id='main-content'>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

            <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

            <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>

            <div class="entry">
                <?php the_content(); ?>
            </div>

            <div class="postmetadata">
                <?php the_tags('Tags: ', ', ', '<br />'); ?>
                Posted in <?php the_category(', ') ?> |
                <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
            </div>

        </div>

    <?php endwhile; ?>

    <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>

    <?php else : ?>

        <h2>Not Found</h2>

    <?php endif; ?>
   
</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Q: How do I load my custom theme once I have finished?
A: Copy the Custom theme folder to your new WordPress installation and put it in wp-content > themes. Then you can activate the new theme and work with it from there.
Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed WordPress 3: Creating and Editing Custom Themes.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked