Before the loop in your taxonomy-locations.php
file,
global $wp_query;
$args = array_merge( $wp_query->query, array( 'post_type' => 'report' ) );
query_posts( $args );
You could, alternatively, modify the query using an appropriate hook (this would be the most effecient method) – but since it is run for most queries, you would need to check it’s actually a query for which you want to set post type to ‘report’. For example:
function my_restrict_to_report() {
//And any other checks
if (!is_admin() && is_tax('location')) {
set_query_var('post_type','report');
}
}
add_action( 'pre_get_posts', 'my_restrict_to_report' );
Not tested
Related Posts:
- limit selection of custom taxonomies to one?
- Filtering a custom post type by custom taxonomy in archive template
- get term archive url / link
- Get term slug of current post
- Create a shortcode to display custom post types with a specific taxonomy
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Custom Taxonomy Template Post List with Sort Order
- The Operator “NOT IN” Does Not Work In tax_query
- wp_insert_term doesn’t work with custom post type’s taxonomy
- Populate Taxonomy from Custom Posts
- Show related posts on single page by custom taxonomy on custom post
- Exclude from search all custom posts which are NOT in a taxonomy term
- Sorting for each custom taxonomy
- Post type archive page not working
- How to get the parent’s taxonomy?
- Help with hierarchical custom taxonomies and permalinks…almost there
- wp_insert_post custom taxonomy
- Custom Taxonomy returns no posts
- Display taxonomy term only if there’s a value
- How to show custom taxonomy in the permalink?
- Get all taxonomies for all post types
- Working with Next and Prev links in Single Taxonomy Templates
- Linking three taxonomies with ACF
- How to List Thumbnails based on Custom Categories
- Search by category displaying wrong items
- Permalinks for custom post-types within custom taxonomies not found
- How to add a custom taxonomy to a custom post type’s document tab
- WP_Query search posts by custom post type and custom taxonomy
- Count posts with specific term_meta
- Custom Post Types and independent Categories – complex Taxonomy
- get_posts of Custom Post Type AND Custom Taxonomy
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to add a custom taxonomy to show up in a custom post type menu?
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Create template for taxonomy results limited by Custom Post Type
- Query Custom posts of same taxonomy as the post itself
- WordPress sort search results by custom order
- Query taxonomy of taxonomy of custom post type
- How can I made custom taxonomies relationship?
- How to conditionally redirect to the post from a taxonomy page?
- How to change permalink to include custom post type
- set permalink for CPT
- Taxonomy/Custom post type structure suggestion on a movie site
- Listing all term items alphabetically / sorting loop
- Change the Custom Taxonomy URL Slug pattern
- Losing Nav Active State in Menu
- Check if post has specific tag_ID in custom post type
- custom post type vs. conditionally displaying meta boxes for specific terms?
- How to make WP_Query not to show irrelevant posts?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- How to list tags from custom post type attachments?
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?
- Dynamically insert code to custom post type loop
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Custom taxonomy template list not working (404)
- Link From Single Post To Taxonomy Term Archive Page
- How to display custom taxonomy term meta on custom post type
- Print all the tags from a custom post type
- How to organize custom post type list by year?
- does wp_insert_term link the term to a certain post ID?
- Calling related posts to a custom post type, taxonomy & Tag id
- What should I learn to develop event management in wordpress? [closed]
- Custom post type category permalinks and archive pages
- Better in the long run to use post date or custom taxonomy to sort/separate posts by year?
- add_filter get array data before display in custom post_type
- Custom endpoint filtering post by custom taxonomies
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- Custom post type rewrite url structure with taxonomy and sub taxonomy
- Custom Post Type with Category Separate
- Define multiple prefixes for custom post type
- Remove custom taxonamy slug with pagination
- Related posts by taxonomies does not work , what could be the reason?
- Display first post of a term in taxonomy template
- How to transfer categories (default) to custom taxonomy?
- Order archive custom posts by taxonomy term [duplicate]
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- Problem displaying posts for a category in a custom taxonomy
- Create Inclusions and exclusions
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Custom taxonomy- only output relevant terms
- Post types showing tables…Can I do that?
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Same permalink structure for all post types?
- Dropdown switching subcategories portfolio
- WordPress custom post type
- How to have working breadcrumbs with several taxonomies associated with a custom post type
- How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
- Prevent repetitive terms in get_the_term_list
- Displaying posts exclusively in their category (not parent)
- Show taxonomies from specific CPT
- Category / Custom Post Type permalink issue
- link posts to custom post type
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- See the process of creating a taxonomy and tell me where I made a mistake
- Navigation won’t update to show full path to single post
- Advise on Custom Taxonomies and Structure
- Show custom category archive as front page and remove taxonomy slug from urls