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 s
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()
parameterhas_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