The loop for $listings
should include a call to $listings->the_post()
so that the global post
object is assigned to the current listing in the loop:
while ( $listings->have_posts() ) {
/*** Add the following line: ***/
$listings->the_post();
$post_get = get_the_ID();
$term_get = get_the_terms($post_get, 'Car_Series');
$term_array = $term_get;
print_r($term_get);
array_push( $term_array, $term_get);
}
Without this, functions that rely on the global post object, such as get_the_ID()
will not return the expected results.
Related Posts:
- Complex Taxonomy scheme
- “tax_query” parameter not working with WP_Query
- How to add images to taxonomies?
- Custom Taxonomy and Tax_Query
- pre_get_posts with tax_query causes empty result
- Taxonomy menu with post count and multiple parents
- Including all terms in wordpress tax_query
- Widget to display custom taxonomy tag cloud
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- search query within custom taxonomy term, post title and meta field
- tax_query not working on main query
- Combine multiple custom user taxonomy in single url
- Ordering Posts with Custom Taxonomy Terms Array
- List taxonomy / category count showing list published posts only
- why do drafts return as part of wp_query?
- Dynamically tax_query terms
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- How to output content based on same custom taxonomy?
- How do I sort posts by custom taxonomy?
- pre_get_posts Tax Query not working for custom author page
- Get pages only with a specific taxonomy
- How to add autocomplete to custom taxonomy for CPT
- Create Advanced search with taxonomies (not filter list)
- Custom taxonomy query not working with switch_to_blog
- ‘wp’ action hook not firing in admin and login?
- Taxonomy archive showing no results
- Get taxonomy parent using child slug (from merged taxonomies)
- How do I taxonomy terms based on terms they are used alongside?
- Querying two taxonomies
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- Taxonomies on custom taxonomies
- How do I display the grand child items of a taxonomy term?
- Custom Taxonomy Not Working When added to WordPress Search
- Custom taxonomy terms in the admin site is not saving for widget
- Widget Logic use with Custom Taxonomy
- How to show all post related taxonomies
- Select multiple categories from CPT to display in LayersWP builder widget
- Widget dropdown always displays first option
- Hiding taxonomies with no children WP_Query & tax_query
- Passing form inputs into multi-taxonomy query
- Set tax_query conditionally with new WP_Query
- tax_query not working
- Using wp_dropdown_categories in widget options
- How to do a particular wp_query taxonomy search
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- wp_dropdown_categories – how to save in widget?
- Remove taxonomy widget from “PAGE” post
- Create alphabetical Pagination for custom taxonomy?
- Custom arguments in WP_Query
- WP_Query tax_query – Show results if child has parent X
- how to access the $query variable inside taxonomy-xxx.php template file?
- List terms of custom taxonomy if matches other taxonomy
- how to use tax_query to apply both terms or one if one is empty
- Showing relevant categories on custom taxonomy template
- How to get related taxonomies based on a category with mysql query?
- Get Posts Related to Category By category id or slug
- Display just the Post’s parent Category, not child
- Get custom taxonomy terms that contain posts that have another taxonomy term
- Custom Taxonomies Archive Page 404
- Tax-query on taxonomy doesn´t work
- how do you pull data from two taxonomies?
- list all post who have mutual taxonomy as current taxonomy!
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Query Multiple Taxonomies and Multiple Terms with Different Operators
- WP Tax query & order by tax query not working
- WordPress Multiple Taxonomy Query
- Multiple taxonomies, what should the permalink look like?
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Tax query array terms display out of order
- Advanced AND tax_query in sidebar with 2 taxonomies
- How to get multiple Taxonomies not All Taxonomies?
- How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- How to limit posts to 1 from each term with tax_query?
- wp_get_object_terms count on taxonomies within an category archive
- Hide empty categories on widget
- Having trouble querying multiple custom taxonomies
- Using wp_query is it possible to orderby taxonomy?
- How do I exclude a custom taxonomy from the post loop
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- How can I get only parent terms?
- How to modify a taxonomy that’s already registered
- Retrieve posts by term id custom query
- Change order of Custom Taxonomy List
- Get the the top-level parent of a custom taxonomy term
- get_the_term_list without links in 3.1
- Inserting terms in an Hierarchical Taxonomy
- get_terms – only top level
- Custom taxonomy terms not showing as list Gutenberg Editor
- Altering the appearance of custom taxonomy inputs
- How to only list the child terms of a taxonomy and not their parents?
- Get term SLUG by term ID
- Is ACF being a honey trap? [closed]
- Get term name from term ID?
- Check if Current Category has Children
- How to use taxonomies on attachments with the new Media Library?
- Hierarchical taxonomy UI
- WordPress taxonomy radio buttons
- How to prevent new terms being added to a custom taxonomy?