I think the simplest way would be to run the loop for each status and only output posts that match the current status:
$statuses = array( 'Active', 'Pending', 'Sold' );
foreach( $statuses as $status ):
echo $status;
while( have_posts() ):
the_post();
if( has_term( $status, 'vr_listing_status' ) ):
the_title();
endif;
endwhile;
rewind_posts();
endforeach;
A couple of additional notes – if this is the main query, alter it via the pre_get_posts
action rather than using query_posts
in the template. If this is an additional query and not the main query, use WP_Query
.
Related Posts:
- custom post type and user post count shortcode
- what is the correct way to compare dates in a WP query_posts meta_query
- Redirect after deleting post and keep track of pagination
- Query posts by custom post type and custom taxonomy
- Query post types with multiple keys
- Remove POST_TYPE from custom post type permalink
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- Get all posts WHERE custom_field is LIKE value
- Custom Post Type | Fatal Error on register_post_type()
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Get rewrite slug of custom post type in template
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- attach CPT data to a taxonomy
- How to insert data into meta box from another plugin?
- Convert Custom Table Data Based Plugin To Be Searchable
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Create a post automatically if search result has zero results
- Registering an optional custom post type from a plugin
- Add category slug as class attribute in a link array
- Add Excerpt On Quicksand Plugin
- Multiple Block Quotes without using HTML
- What’s the best way to show custom post types? With page template it’s not perfect!
- Inserting two categories
- Set a Custom Post Type as a Homepage
- Quick edit screen customization
- Mini-Site Strategy
- Custom Post Types on Category Pages
- How do I filter the excerpt metabox description in admin?
- Setting up custom post type archives in WP3.1? Any luck?
- Querying custom posts and regular posts
- TV Show database – Best way for structuring it?
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Using Offset in Custom Post Type Query
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Get the post children count of a post
- ‘category__and’ for custom taxonomy?
- How could I create a ‘private comments’ section on a custom post type?
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Issue with pre_get_posts on custom post type archive pages
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How to Mass Delete Images from Media Library
- List custom taxonomy specific to one custom post type
- Hide parent categories when clicked, and show it’s childs
- Best structure / rewrite rules to achieve the following url
- Filter date from post meta when date is in string format
- wordpress remove views from action links in a custom post
- 404 Error on form submission within custom post type
- Send a conditional email notification when a custom field value changes in Post Type
- 3 random images from custom post type, each in a div with a diffrent class
- why is the current page title being output?
- Displaying multiple post types on home page
- Conflict between wp_list_pages and get_posts – list pages not displaying
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Targeting custom post type via functions.php doesn’t work
- How to export custom post type with ACF to individual file with automation?
- Add post type pages with plugin
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Most viewed post of custom post type
- Custom taxonomy not saving correctly
- Can I get an auto-populated dropdown list of other custom posts in a custom post edit page?
- Custom post type page with parameter
- Custom Query: Multiple CPTs and a taxonomy filter
- How to show the post which checkbox is not selected
- Replace Content of Sidebar on Custom Post Type
- Filling custom post type posts from a rest api
- WordPress next post by ajax call on button click
- Modify default Related Posts Code to Custom Post Type
- Adding specific custom fields (images) to post excerpt
- My post loop needs to have 8 different post templates
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Which File Populating CPTs in Slug URL
- Front End users account with lots of user Roles (not Woocommerce)
- Foreach in get_post_types to apply a different filter per post type
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- display news with pictures 3 small and one large (loop)
- Selecting which pages to display custom post type on using checkbox
- Custom post type blog pagination conflict
- Resources to learn OOP for WordPress plugins, custom post types, etc
- Is There A Way To Add Another Field To Custom Post Type (Not Custom Field/Meta)?
- How to add custom column to Custom post page list?
- How to create an upload page (front side)
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs