I fixed it by doing it a different way
$query = new WP_Query(array(
'post_type' => 'tracks',
'posts_per_page' => -1,
'orderby' => 'meta_value_num',
'meta_key' => 'track_number',
'meta_query' => array(
array(
'meta_key' => 'mixtape',
'meta_value' => (string)$mixtape_id
)
)
));
Related Posts:
- How to create posts (not post template) to be displayed on projects page?
- How do I create an archive page for standard posts?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Loop on front-page.php
- Custom WP_Query doesn’t display all posts
- display posts of custom post type with custom taxonomy
- Display post from custom post type
- How to fetch posts that are stored in the different table than (default) wp_posts?
- SEARCH QUERIES – REVERSE OUTPUT
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom post Query and WordPress Post Query Clash
- Only show current category post
- How To Loop Through list with Custom Post Types
- Lists Posts from CPT that match the Title of the Page
- Remove parent from custom post type
- Help Structuring Query for Archive Pages
- get_template_part for custom post type content not working
- wp_query to find posts by year and month
- WP_Query is printing out only one post when posts_per_page is set to multiple
- How to get all posts except for one post from a certain custom post type?
- Remove duplicated values from a loop
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- is there a way to retrieve posts that do not have a featured image assigned?
- WP_Query | ‘post_type’ doesn’t work
- How to connect two custom post types with nested loops
- Filter by custom taxonomy slug on a custom post type
- Query custom post type in the loop
- Loop through Custom Post Type, and then show children within each iteration
- Very Slow Page – How to Optimize # of Queries?
- Can I create a loop with multiple post types and specify different $args for each post type?
- How to add post_type=value when editing that post type in the WordPress admin?
- Display CPT posts based on specific taxonomy
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- WP_Query orderby modified to include custom meta changes
- How to make sure content doesn’t display if selection is empty
- Show one item per category of a custom post type
- Storing posts from query and accessing later via AJAX call
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Show custom post type filtered by category
- Custom loop with multiple taxonomy queries
- I would like to have different styles for my posts based on the content of each post
- Get latest 3 posts from multiple CPT in one query
- Allow non-logged in users to see a future post after clicking on a list of future posts
- List custom taxonomy specific to one custom post type
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Return the latest post from a custom Taxonomy and Post Type
- JS innerhtml changing style when using AJAX
- What’s the WP way to load remaining custom posts?
- How to change the post type a theme shows by default?
- Several post types on WP Query by tag and taxonomy
- WP Query with categories only shows one post and ignores the category
- Shortcode not working with post counter
- How to have this permalink structure: post_type/postname/custom_inner_page
- Problem: wp_query outputs all images on site
- Prioritize posts in query by meta keys?
- How to get all tags of a custom post type by id
- pagination not working for category.php (custom post types in categories)
- Redirect to another page using contact form 7? [closed]
- WP the_posts() on single-cars.php get category link
- Conditional for a Single Post That Belongs to a Category?
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- Different Limit number of post on different archive page
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Custom post types and ‘new WP_Query’
- Query & the_content() is showing in the header
- Variable not working in WP_Query
- Two column layout with alphabetical ordering
- get_pagination not working on a custom post type query (using WP_Query)
- How to Make infinite loop of post
- how to get this tax_query working?
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Pagination not working on custom query on a page
- Query within a foreach within a query (queryception)
- wordpress lists similar type of posts in a custom post type
- Get post format
- Custom wordpress loop
- Assign a template to a custom post type when displayed by the main loop on the home page
- Custom Post type content within a slider
- Trying to add a class to post links
- How to Query in WordPress which shows Alphabetic Posts?
- displaying content of custom post type
- postsperpage value not being applied
- Posts are not rendering perfectly [closed]
- Display the current post in browser as the first post in a loop (for a slideshow)
- how to handle the loop using filling bootstrap grid structure?
- How to query Posts from a custom post type which contains a custom taxonomy?
- Use post in multiple places on a page with multiple posts
- List all Custom Post Type posts excluding certain Taxnomy term
- Searching post types
- foreach loop inside the loop creating duplicates in output
- list posts of two post types in a single template
- The loop does not show users
- How to retrive Custom Post Type Meta Fields in Custom WP_Query