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

WordPress 3: Creating and Editing Custom Themes

Setting up WordPress and WAMP on a Windows computer


From:

WordPress 3: Creating and Editing Custom Themes

with Chris Coyier

Video: Setting up WordPress and WAMP on a Windows computer

I'd like to cover installing and working with WordPress locally on a Windows machine as well. So, I'm here in Windows 7. I'm going to open up our web browser. Now on the Mac, we went to and used a tool called MAMP, which stood for Mac, Apache, PHP, and MySQL. On Windows, we're going to use a tool called WAMP. So we can just do a search for WAMP. The first result here is wampserver.com. That stands for Windows, Apache, MySQL, and PHP. So this is free.
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

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

Setting up WordPress and WAMP on a Windows computer

I'd like to cover installing and working with WordPress locally on a Windows machine as well. So, I'm here in Windows 7. I'm going to open up our web browser. Now on the Mac, we went to and used a tool called MAMP, which stood for Mac, Apache, PHP, and MySQL. On Windows, we're going to use a tool called WAMP. So we can just do a search for WAMP. The first result here is wampserver.com. That stands for Windows, Apache, MySQL, and PHP. So this is free.

You can download it and install it. I've already done that. That puts a little thing in your Task Tray here, this little WAMP Server. It says server offline. I can click that and click Start All Services. That's going to startup all of those local servers that we need running for us here. I'll go back into our web browser, and then I'll browse to localhost. That's where our local environment is going to be. You can see, it says "Howdy, folks" here in the browser. So where is that coming from? I'm going to open up our Computer, and browse to our local C drive where we have WAMP installed.

Open up the WAMP folder, open up the www folder. Within that is this index file. So if I right-click that, and go Edit with Notepad++. That's the text editor we'll be using. There is just one line of PHP in here. It says echo 'Howdy, folks!.' Now that's proving to us that PHP is working and that this www directory is the root that we're going to be working with. Now in this root is where we want to install WordPress. So we need a copy of WordPress to install.

We open a new tab here, and go to wordpress.org where we can download the latest, greatest, freshest copy of WordPress that we can get. Click the Download button. Then I'm going to right- click and say Save Target As. It's going to download. I'm going to download it into our Documents folder here, and let that go. It's pretty quick download here. We're going to open it up when it finishes, and we'll be able to see all the files that are a WordPress installation.

Now I am going to need to move those into our root, our document here. So let me minimize our browser window here. This is our root for localhost, and these are the WordPress files we just installed. So let me select all and drag those over here. It's going to copy them over here. It might give us a little grief in two seconds, because there is already an index.php file over here, and WordPress has its own. So I'm going to make sure to replace the one that WordPress comes with.

Now there is this file called wp-config-sample. Ultimately, we're going to have to remove the -sample from that. WordPress needs a wp-config file. So I'm going to say Rename. I'm going to remove the -sample from it. That's the file where we're going to put our database connection info into. So now that this is here. If we go back up to the web and we reload our localhost, it's going to give us some grief about establishing a database connection, because we don't have a database yet for this.

Now we can manage databases with WAMP. I'm going to open up the System Tray. Go under this WAMPServer thing here and go up to phpMyAdmin. That's a browser-based tool for dealing with databases. It comes with that WAMP download that we downloaded. I'm going to make a new database. So I'm going to under Databases, say Create new database down here, and just call it wordpress. Create. That's really all we need to do. We've created this database for WordPress.

Let me just look under Privileges quick. There is one user. It looks like there are two users here, our localhost user. We're going to go ahead and Edit and make sure that it doesn't need a password, and hit Go. Now we can close that out. We've done all we need to do with the database. We're going to edit that wp-config file. I am going to hit Edit with Notepad++. Open that up. Change the database_name to what we just created, wordpress.

Change our username to root. Then we said no password. So password can go away. Then we'll hit Save. Come back out to the web. Reload the page. It should be able to connect to that database and show us our install screen. So that's proof that we did our job good. So to install, we'll just call our site Widget Corp. Make a user for myself. Pick a nice strong password. Enter my email.

Leave the checkbox checked asking us about search engines. Click Install WordPress. It goes really, really quick. It installs the database tables in there. I'll click the Log in button. Enter my username and password that I just created. Log in. That's it. Internet Explorer is asking me if you want to save the password. You can just click No for now. We're looking at the WordPress dashboard. So WordPress is installed, and we're ready to go. I can click the title of the site up here, look at the front end of the site, and isn't that pretty? We have a locally running version of WordPress on our Windows computer.

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