Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Create a Blog Archive Page1:51 with Zac Gordon
Create a Blog Archive Page
Right now when we click on a category, it takes us to a categories news
page that is using again the template of index.php.
However, we're going to create a template of archive.php and that will work as the
default landing page for all of our
category as well as searching by date archives.
What I could do is come in and
open up home.php and simply save it as archive.php.
Now when we click on News or Specials, the URL will
update and it will only show ones that have that specific category.
We click on Specials it will do the same there.
We could also come into our Widgets,
remove the Comments widget and instead display Archives,
come into our Posts and edit them, so that they've displayed,
over the course of several months.
And then when we view our blog, we could also click
and get them sorted by date.
We'll add one more Widget of the Categories.
And we'll remove Recent Posts.
And we could see that this archive page is now dynamically working properly.
You need to sign up for Treehouse in order to download course files.Sign up