1 00:00:00,000 --> 00:00:04,804 [MUSIC] 2 00:00:04,804 --> 00:00:07,216 Now that we have our custom post types up and 3 00:00:07,216 --> 00:00:12,390 running, let's take a look of how to set up an entire blog section for our site. 4 00:00:12,390 --> 00:00:15,920 This will involve a couple different templates including ones that 5 00:00:15,920 --> 00:00:20,690 we use to list the blog posts, to display a single blog post. 6 00:00:20,690 --> 00:00:24,889 And to display an archive of different related types of posts. 7 00:00:26,020 --> 00:00:28,830 If we come back to our original static template, 8 00:00:28,830 --> 00:00:34,350 we can see that we have a nice layout set-up for blog section of the site. 9 00:00:34,350 --> 00:00:39,880 This is a two column layout with a title, excerpt, images if we need, and 10 00:00:39,880 --> 00:00:43,160 then some meta-information that can go below it. 11 00:00:43,160 --> 00:00:45,190 Followed by the post itself. 12 00:00:48,530 --> 00:00:52,340 So, what we're going to do now is we're going to create the template that will 13 00:00:52,340 --> 00:00:55,540 control this blog listing page. 14 00:00:55,540 --> 00:00:59,952 And that template is called home.php. 15 00:00:59,952 --> 00:01:04,528 Since the template is very similar to our left sidebar template, 16 00:01:04,528 --> 00:01:10,120 we're going to start with this and do a File > Save As for home.php. 17 00:01:10,120 --> 00:01:14,120 We can remove this markup at the top that tells what the template name is. 18 00:01:14,120 --> 00:01:18,970 And since we are using the naming convention of home.php WordPress will 19 00:01:18,970 --> 00:01:22,450 know to use this template as the home page for our blog. 20 00:01:23,530 --> 00:01:28,000 So if we come back to our site and into pages, 21 00:01:28,000 --> 00:01:30,800 we need to make sure that we have a blog page. 22 00:01:35,840 --> 00:01:38,270 Fact what, we'll add some content here cuz I'll show you. 23 00:01:43,190 --> 00:01:45,910 Now remember when we set up our custom post type for 24 00:01:45,910 --> 00:01:49,680 the main portfolio page we selected a template. 25 00:01:49,680 --> 00:01:53,711 However WordPress will know that we automatically want to 26 00:01:53,711 --> 00:01:56,353 use the home.php template for this. 27 00:01:56,353 --> 00:02:00,292 By us coming in to customize and making sure that 28 00:02:00,292 --> 00:02:06,430 we're telling it right here that our posts page is going to be home.php. 29 00:02:06,430 --> 00:02:07,870 So we Save and Publish that. 30 00:02:09,540 --> 00:02:14,880 And now when we, oops, it looks like we set it up to 31 00:02:14,880 --> 00:02:20,340 have our static page, I'm sorry, we want this to be on the blog. 32 00:02:20,340 --> 00:02:24,020 There we go, front page is static and posts page is blog. 33 00:02:24,020 --> 00:02:30,221 Good, and then we'll come back. 34 00:02:30,221 --> 00:02:34,350 Looks like we have to add blog to our menu here. 35 00:02:34,350 --> 00:02:43,398 [BLANK_AUDIO] 36 00:02:43,398 --> 00:02:44,960 And put it after the About section. 37 00:02:46,330 --> 00:02:48,120 And then we come back and view our site. 38 00:02:48,120 --> 00:02:50,670 Now we could see our blog, and there we go. 39 00:02:50,670 --> 00:02:53,840 We have our two blog posts that are entered in the back end, 40 00:02:53,840 --> 00:02:58,160 if you've added more or less blog posts, you'll see those show up. 41 00:02:58,160 --> 00:03:03,310 However, it's using the mark up of just having a header tag. 42 00:03:03,310 --> 00:03:05,060 And then, the content below it. 43 00:03:05,060 --> 00:03:09,750 So there's no link here, that is going to a particular page. 44 00:03:09,750 --> 00:03:13,690 What we need to do now, is make sure that the mark up is correct for 45 00:03:13,690 --> 00:03:15,330 their particular post. 46 00:03:15,330 --> 00:03:19,699 And if we come back to our template, that includes having a link here, 47 00:03:19,699 --> 00:03:21,042 some sorta excerpt. 48 00:03:21,042 --> 00:03:24,970 And then a little metadata followed by the post itself. 49 00:03:24,970 --> 00:03:29,440 But, what we're going to do is just display an excerpt of the data instead of 50 00:03:29,440 --> 00:03:30,820 the full post there. 51 00:03:30,820 --> 00:03:33,060 So, that you can see the different ways to do that. 52 00:03:34,530 --> 00:03:37,820 So, now lets jump into the next level of code that we'll be using for 53 00:03:37,820 --> 00:03:38,520 this template.