A simple method would be to create a archive template file for the location
taxonomy, and then include the proper inner-template for each post type.
First, create a PHP file in your theme’s root folder, named taxonomy-location.php
. Then, you can use get_post_type()
insider this template the include the proper template:
get_template_part( 'templates', get_post_type() . '-content' );
Now, you can create 2 different PHP files named template-content.php
and template-location-content.php
. Feel free to edit the to suit your styles.
Related Posts:
- Archive or taxonomy pages not working for custom post type
- Custom post type templating problem
- Getting custom taxonomy posts on archive page
- How to get_queried_object on multiple objects?
- Custom Post Type / Taxonomy Slug / Post Title with post type archive
- Custom Post Type with Nested Taxonomy and Template Files
- Hide child term posts on parent term pages
- Posts per Page on custom Taxonomy Template
- Post type archive page not working
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Archive page for taxonomy of custom post type
- Should I change these content meta types before building complex archive page?
- Getting taxonomy terms used by custom post type
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Trying to manage templates on a blog with lots of custom taxonomies
- How to create archive page for taxonomy terms within custom post type
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- Custom post type and taxonomy permalinks – Structure
- taxonomy template for custom post type the same as the archive
- Display only post types that are direct children of the current taxonomy
- Custom Taxonomy term archive template
- How can I filter by taxonomy on a custom post type’s page?
- Custom template won’t load for a custom post type (custom permalinks used)
- Create template for taxonomy results limited by Custom Post Type
- Extending AZIndex plugin to use custom post types and custom taxonomies
- Use Custom Post Type archive page for the taxonomies term archive page
- Display custom post type category, while in a CPT category, then the posts beneath
- Number of Custom Post Types published are not being shown in the custom page
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- WordPress Doesn’t Generate Taxonomy Archive
- posttype/taxonomy/term archive page 404 error
- Custom Post Archive is not working
- What’s the name of the custom post type yearly archive template?
- Alphabetically sort a taxonomy.php template by post title
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Permalink problems with custom post type and custom taxonomy
- sort CPT on Custom Taxonomy Archive page
- Use the custom post type archive for taxonomies?
- Custom Post type date archive for custom taxonomy
- Show categories of custom post type and not all posts
- Query Posts that have Custom Taxonomy
- Custom Post Type Custom Archive Page Not Working
- Archive page for custom post type and custom taxonomy
- Custom post type category permalinks and archive pages
- Displaying custom taxonomy menu in custom post type archive
- Custom post types templates
- Archive page of taxonomy returns a 404 error
- Archive page of CPT’s custom Taxonomy
- Getting Same Description in All the Custom Taxonomy Posts
- Displaying all posts by category and showing content on click
- pagination problem listing custom post types of taxonomy in wordpress
- Posts per Page on custom Taxonomy Template
- Static Front Page not working for custom theme
- Building Link List for Custom Tax
- Custom taxonomy with custom post type archive page
- Specific template for subcategory of custom taxomy
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- taxonomy – templates are not loading
- Templates for CPT not working
- Single taxonomy for different custom post types
- Custom post type post_type_link gives “page not found” on any other custom post type
- Custome post type “tags” pick default archive instead of custom post type archive
- Customize url from the_terms
- Custom post types not displaying per category
- Help with Multi Level Category Archive Page
- Custom post type archive page not showing on archive-posttype.php
- Custom taxonomy in custom post type archive with pagination
- Pagination fault in custom post type archive page [duplicate]
- Custom post type category page not working
- Why is this custom post type defaulting to archive.php?
- title tag for custom post type remove taxonomy name from title tag
- List a custom taxonomy’s terms, with links, on the taxonomy page
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Custom taxonomy archive page not routing?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom taxonomy meta fields
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- How to assign a single-menu-template to a menu-items in a taxony/ cat/ subcat/ subcat-item
- Rewrite taxonomy permalink appended to CPT archive url
- Query Pulling the same post twice
- template structure for CPT not clear
- Dropdown switching subcategories portfolio
- Multiple post types or single post type with category taxonomy?
- How to add base permalink to custom posts?
- Cannot retrieve Custom Taxonomies (Disappeared)
- Add a meta to custom post type which corresponds to a particular taxonomy
- Custom Post type and Taxonomy in post URL error
- Is it possible to add and display custom post types to an array?
- Rewriting archive page slug to be different than custom post type slug
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- Display Custom taxonomy, Child terms and posts in a template Under Specific Parent terms
- Get posts in same category not working
- Custom Homepage As Single Page or Custom Post Type?
- Heirarchical URLs with CPT and custom taxonomy
- Custom taxonomy page template
- Displaying taxonomies with manage_{custom-post-type}_posts_custom_column
- How do I put `tax_query` in this WP_query?