Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So the structure of our website is looking good, our sidebar is looking good, but one thing you will notice that is drastically different from what we're looking at right here from what we ended up with, our Photoshop design and our HTML and CSS template, is this main content area doesn't look anything like our final design. We just haven't got in there yet, but this is what we are going to be doing, creating a custom homepage with our WordPress Theme. Now WordPress actually makes it pretty easy to do. So, I am going to show you on the right here we have open our TextMate project with all the files from a WordPress theme, and on the left we have this TextMate project.
That's where we left off with our static HTML and CSS templates. So, what I can do to make a custom homepage-- You don't have to do anything fancy. It's really easy. I am going to make a new file by clicking on the folder at the top of the sidebar and say New File. We're going to create a new file for our theme. I'm going to call it home.php. Now it comes in as a blank file and if I just type like "hey guys" in here and saved it and went back out to the web. Looked at our site, we are at the homepage right now. It's just going to say "hey guys." zit's going to know the currently active theme has this home.php file in it, and the homepage just going to render that page by default.
So whatever I put in here it's going to show up on our homepage. Now our index.php file is a good starting point anyway. So let me just copy that entire block of code and past it over here and hit Save in our home.php file. Reload the page and we are going be back right where we started exactly. Now, everything is right about this except for this block here, this main content block. So if I were to just go ahead and grab everything from the main content block and delete it, it's going to do probably what you think it's going to do.
There is just going to be nothing inside there instead. So what we're going to do is replace that with what we have already designed for our homepage and then grab everything from the main content div over here and just drop it in over here. Now one thing that's not going to be ready is these images of our products. We have to make sure that those exist on our kind of live local environment so that they don't come up as broken images. So let me just minimize our projects. Minimize the web so we can look at what's going on out here in the Finder.
This htdocs folder is the root of our website and that's where I want to make those product images available from. So here they are in our static HTML and CSS template. I am going to drag those over to the root of our htdocs over here. Now I didn't drop them in the theme, because I kind of have this theory that these are going to be their product images despite what theme is active. So let's not put them in the specific theme. Let's just put them at the root. That's appropriate. And then we'll go in and make sure that those file paths are correct here, so we are going to be in product-images and /product-images and I'll hit Save.
We'll come back out to the web and reload and our custom homepage will be present there, and everything is looking good. So that's how easy it is to make a custom homepage for the site that's completely unique to the homepage, totally different template than any other template on the site. It's just as easy as making your home.php file on your theme and putting in the stuff in it that you would want to be there. Now it's maybe not as dynamic as we hope it to be later. We are going to make these products later pull dynamically from the store, once we've created those, but we will revisit that later.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 97398 Viewers
61 Video lessons · 84633 Viewers
71 Video lessons · 68840 Viewers
56 Video lessons · 101296 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.