You need to use the methods of your query instance, rather than the global functions (which are merely wrappers for the global $wp_query
):
if ( $query->have_posts() ) {
$term = $query->queried_object;
while ( $query->have_posts() ) : $query->the_post();
//Output my posts
the_title();
the_content();
endwhile;
}
Related Posts:
- query multiple taxonomies
- Querying Posts by Taxonomy From Alternate Network Site
- Sort the main query in subcategories/terms?
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Querying Term Posts in Loop
- Filtering WP_Query Dynamically on the Front-End
- Search / Filter posts on Title/Content OR Tags
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Query custom posts from custom taxonomy
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- display post count in archive page that have relation with another taxonomy term
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Display all Custom taxonomy terms and their relevant custom posts
- Query Pulling the same post twice
- How to pass taxonomy terms to WP_Query along with $args?
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- get_post_meta returns empty array for terms
- Display CPT posts based on specific taxonomy
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- shortcode to show custom post types by category
- Update post terms with custom taxonomy
- How do I display tags for a custom post type single page?
- Am unable to reset a query properly
- Query/list all terms and their custom post count
- Custom Post Type Archive Page Filtering
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Get template part using a custom taxonomy term
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to restrict users and admin from creating new taxonomy terms?
- Get next and previous 3 posts in a term in single post page
- wp_query check if integer exists in custom field’s array
- convert custom query to wp_query
- Wrong request query on cpt and tax
- Get custom taxonomies from multiple posts
- Making certain categories of CPT not publicly queryable
- Pagination for Custom Taxonomy Page [duplicate]
- using $wpdb to get custom post type with term
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Show posts from two or more custom taxonomy terms
- Allow user to set custom order to a list of custom taxonomies?
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Displaying custom taxonomy in the admin list of a custom post type
- Get parse_query filter to return slug instead of id
- Which post does a taxonomy term belongs to?
- How do I move/order posts with a tag to the end?
- Display post as term id
- Custom taxonomy rewrite give pagination 404
- How do I display the taxonomy term alongside the post type post title?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Custom post taxonomies as tax_query terms?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- creat filter with wp_query
- Post count by month of taxonmy term
- Custom WP Query on custom meta and sort by multiple meta keys value
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Specific query for custom post type
- Custom taxonomies relationship
- How do I display the taxonomy for a custom post type in an array
- Display Custom Taxonomy Alphabetically
- How to have this permalink structure: post_type/postname/custom_inner_page
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post, set object Taxonomy terms in plugin
- Query Custom Post Type Taxonomy term with multiple parameters
- Display post content with respect to its title?
- Get terms that contain posts that in turn belong to other terms?
- How to get custom posts sub category link
- Custom while loop for hierarchical display of a taxonomy
- Prioritize posts in query by meta keys?
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- Display taxonomy terms, child terms and posts in a template
- Use custom walker to add taxonomy terms to main nav menu
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Different Ways to Query Custom Post Types?
- Add term to custom post type on draft
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Listing all term items alphabetically / sorting loop
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Retrieve custom post types by custom taxonomies with WP_Query
- How to get WordPress term attached to the Post?
- Query posts with double taxonomy
- Showing specific post in order of array wp_query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Print current post category during WP_Query
- Adding predefined terms to a taxonomy
- How to make WP_Query not to show irrelevant posts?