quick info, use this to know what is being return:
$loop = new WP_Query( array(
'post_type' => 'car',
'orderby' => 'title',
'order' => 'asc'
)
);
echo '<pre>';
print_r($loop);
wp_reset_postdata();
Also I believe is better at the end reset the postdata to be sure that nothing is being change in the database. For all I had read this is good to use everytime we open a new WP_Query.
Related Posts:
- Custom post type order by post_title
- WP insert post PHP function dynamically generated Custom Fields
- Inserting data into `post meta` table?
- Custom Post Type order by modified date and custom meta field issue
- WP_Query search posts by custom post type and custom taxonomy
- Conditional to modify query results
- Custom query to filter posts that have current post as a taxonomy [closed]
- creat filter with wp_query
- Querying a custom post type, but not show duplicates
- How do I get the index for a custom post?
- Changing WordPress sort order for returned child pages
- Check that a slug is present in the get_terms request
- Show first posts with custom field not empty and order all by title
- Help ordering custom query by Title, Ascending
- Allow admin to determine the order of queries?
- Posts 2 Posts: query connected — orderby problem
- Code in custom widget queries all posts, when it should only query the current post
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Modifying date filter on admin page for custom post type to link to custom field
- Ignore sticky posts if post is not in meta query
- Loading all files within a directory
- Querying Term Posts in Loop
- How to debug a blank page?
- Blog page showing same content as homepage
- query posts and custom post type with meta key
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Create custom post type on successful woocommerce order [closed]
- Query string parameters from custom fields, inconsistent results
- Custom Post type is being ignored in query
- Adding custom tables to WordPress
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Query custom post type only if it contains another custom post type
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Add post_type to index.php
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Order By Post Type ThenBy Taxonomy
- Getting the URL of the parent page
- Combining sorted and random CPT
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- How to display selected taxonomies by their parent
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Custom Field Order by Last Name and First Name
- Pagination for custom php code
- get_posts of Custom Post Type AND Custom Taxonomy
- What’s the difference between same wp functions get_posts(); functions in different form?
- I did group my search results by post type, but how can i give each of them its own order?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Ordering posts in Search & taxonomy by post_meta
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?
- Am unable to reset a query properly
- Get posts from a custom post type by child categories of a parent category
- Received nothing after executing AJAX post function
- How to make sure content doesn’t display if selection is empty
- Custom post type redirected to homepage – how to debug
- How to modify archive query with pre_get_posts to append CPTs?
- Custom Post-Type not in admin menu
- get the custom post type title/name
- Page vs Custom Post Types Differences/Issues
- If post has custom field then display css-class
- Push metadata in array
- How to customize a permalink (URL) structure?
- Troubles with saving metabox
- Rewrite and custom post type: order by custom field not working
- CPT + CMB2: data not displaying for only first post in loop
- How to make a field appear only if a post meta field has a defined value?
- Replace text in post from cvs
- Get next and previous 3 posts in a term in single post page
- Get parent categories of custom post type
- convert custom query to wp_query
- How to set order for a custom post type
- Previous/Next Link by Meta Value in CPT
- Can I list a custom post type within another custom post type in the admin area?
- Get custom post type list for every category shortcode
- Making certain categories of CPT not publicly queryable
- How do i calculate the total of values of custom fields in custom post types?
- Search / Filter posts on Title/Content OR Tags
- How to order separated Custom Post Search results