Hello ladies and gents!
I'm hoping you can help me with this one.. if it's each possible. I (ideally) need a general template for the categories of a custom post type.
Custom post type: Listings (type-listings) Listing's categories(cat-listings): Lease (lease) & Sale (sale)
So when I visit http://www.domain.com/listings/cat-listings/lease I get a 404 (does this mean that this page is not possible to have? or because I am missing a template. I suspect the former as I know wordpress has default ones to fallback on.) when I'd like to have a page that I can alter... In this page I want to show all of the posts in the lease category, and have the user be able to navigate to the similar sale page with the sale posts.
Now I know I could create a page for each and have them have their custom template pages but the issue I have with this is if my client ever wants to add another category a page and page template has to be created.
Another solution is to have an toggle/tab system where I just create a listings page and have a toggle/tab between the categories. My problem with this is I don't know how many listings there will be and therefore pagination should work. I don't think I could have a toggle/tab and pagination.
Thanks for your help!
I've tried the following and had no luck; cat-listings.php type-listings.php archive-type-listings.php archive-type-listings-cat-listings.php category.php category-type-listings.php category-cat-listings.php category-type-listings-cat-listings.php taxonomy-type-listings.php taxonomy-cat-listings.php taxonomy-type-listings-cat-listings.php
I found this post which sounds like what I need but as you can see from the above list I've tried it without luck. Same template for all the terms of a taxonomy
Here is how I register my custom post type:
register_post_type('type-listings', array(
'labels' => array(
'name' => _x('Our Listings', 'Titles', theme_domain()),
'singular_name' => _x('Listing', 'Titles', theme_domain()),
'menu_name' => _x('Our Listings', 'Titles', theme_domain()),
),
'public' => false,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => _x('listings', 'URL Slug', theme_domain()), 'with_front' => false, 'page' => false),
'capability_type' => 'page',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 21,
'menu_icon' => 'dashicons-admin-home',
'supports' => array('title', 'custom-fields', 'revisions'),
));
$catProjectsArgs = array(
'label' => __('Availability', theme_domain()),
'sort' => true,
'show_ui' => true,
'show_admin_column' => true,
'hierarchical' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'args' => array('orderby' => 'term_order'),
);
register_taxonomy('cat-listings', array('type-listings'), $catProjectsArgs);