9

I am wondering what is the difference between a wordpress archive page, and just a page template listing out posts?

Right now I have a custom archive page, listing all entries of a custom post type. This could very well have been handled by just a normal page.

Right now I am going to list out all blog posts (not on the front page, but as a news option in the menu), and I am wondering if I should use an archive page or create a page template that lists out posts. What is the different in intent for these pages?

2 Answers 2

15

Archive Page

An archive page is part of the WordPress Template Hierarchy, and is the template file WordPress uses to display the archive index list for a given post type. The custom post type archive template hierarchy is as follows:

  • archive-{posttype}.php
  • archive.php
  • index.php

WordPress uses the query parameters to output this page, and posts are output via the main/default query loop.

Advantages

  • Pagination works out of the box
  • No user intervention required to create/display; WordPress creates the archive index view automatically, based on register_post_type() parameter has_archive

Disadvantages

  • Pretty permalink might not be as pretty as you'd like - though you can modify it via register_post_type()

Custom Page Template

A custom page template can be used to display any arbitrary content. When used to display a listing of custom post-type posts, it does so using a secondary query loop.

Advantages

  • User control of pretty permalink, via static page permalink

Disadvantages

  • Pagination will not work out of the box, and must be fixed
  • User intervention required to create this page: create static page, assign page template
1
  • Well, then I think it is better to use the archive way, thanks! Commented Dec 18, 2013 at 21:32
3

Assuming these are going to be all posts within your posts section, and not excluding any, why not create a page in WordPress called "News" and then set that to as your "Posts Page" in Settings -> Reading? (I would have left this as a comment, but it won't let me unless I have a reputation of 50).

The Template Hierarchy may contain some useful information for you as well. I believe in most cases the normal content loop and archive loop are the same, with the archive template it has the variable Page title (ex: "Daily Archives:" "Category Archives:") and you can also create additional archive templates based on different data (like post type, specific category, etc).

Hope that helps!

1
  • Well, all news, which is of the standard post type. I have a custom post type excluded. And the page will be paginated. Commented Dec 18, 2013 at 21:33

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.