If you have a category called Book Reviews
(with a slug of book-reviews
), then the archive page for that category should be http://fantasybookblog.com/book-reviews
without you needing to create a page for it.
If you want to create a custom page template for that category archive, you could create a file in your theme folder called archive-book-reviews.php
and that template would automatically get used whenever someone visits http://fantasybookblog.com/book-reviews
.
All that aside, if you still want to show an archive of book reviews on a Page, you would want to create a custom page template and add a function like this to your theme’s functions.php
file:
function my_book_reviews_template( $query ) {
if ( is_page( 'reviews' ) { // Replace 'reviews' with the slug for your review page
$query->set( 'category_name', 'book-reviews' ); // Replace 'book-reviews' with the slug of your category
}
}
add_action( 'pre_get_posts', 'my_book_reviews_template' );
So to do this, I need to log in to the admin where the blog is posted, right? I can’t seem to get it to work by going through WP
Sorry, my answer may have been a bit too technical. Basically, you can just create a menu link to the ‘Book Reviews’ category archive by going to WP-Admin > Appearance > Menus
. Then whenever someone clicks that category in your navigation menu, they will be brought to an archive page for that category.
If you want to customize this page a bit, that would require adding or modifying theme files (like I explained above), which should really be done via FTP rather than through the WP-Admin interface.
I think I’m going to have to change themes. I’m using the Skirmish theme and it doesn’t appear to support the Custom Menu Widget.
Nope, not going to have to change themes. I just needed to check the box for: Automatically add new top-level pages. That added links to all the category pages to the menu bar.