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
- Display all posts in a custom post type, grouped by a custom taxonomy
- How to use a custom post type as front page?
- Display several random posts, but make sure a condition is met
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Retrieving 3 latest post from each of 5 different custom post types
- Newer/Older posts links display same posts on every page
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- Wp-query causing problems with the_content();
- Query Custom Post by Category
- Quickest way to get last or oldest post date – WP Query
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Integrating Orbit slider into wordpress through custom post type
- get_template_part for custom post type content not working
- 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?
- WP_Query | ‘post_type’ doesn’t work
- Filter by custom taxonomy slug on a custom post type
- Loop through Custom Post Type, and then show children within each iteration
- Can I create a loop with multiple post types and specify different $args for each post type?
- 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
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- 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
- Shortcode not working with post counter
- How to have this permalink structure: post_type/postname/custom_inner_page
- pagination not working for category.php (custom post types in categories)
- Redirect to another page using contact form 7? [closed]
- WP Query post__in not returning correct results
- Different Limit number of post on different archive page
- How can I group posts by months and years?
- Custon Content within WordPress Loop
- Custom post types and ‘new WP_Query’
- get_pagination not working on a custom post type query (using WP_Query)
- How to Make infinite loop of post
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Get post format
- Custom wordpress loop
- Custom Post type content within a slider
- Trying to add a class to post links
- displaying content of custom post type
- 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
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Custom post type pagination error
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Get next and prev item from custom WP_Query and Custom Post Type
- Display Parent-Child Posts in specific order by comparing IDs in array
- How to display custom field in product description?
- Pagination Not Working When Used With WP_Query() `offset` Property
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Custom Post By Category
- Mix Facebook and Twitter feed into custom posts
- How to get the posts that my following users are liked?
- Get post from Category by Priority
- Strange behavior on WP_query
- Loop carousel slider in wordpress
- Custom taxonomy page template
- Custom Post Type + Category archive
- Calling specific page with wp query
- erase post excerpt limitation [×]
- Loop with Custom Post Type and Taxonomies
- display news with pictures 3 small and one large (loop)
- Custom post-type’s pagination not working in category.php
- Pulling in a particular post into a single page based on the post id passed into the code
- Styling first post using Advanced Custom Fields
- Query Custom Post Type by Tag
- How to manage wordpress knowledge base/wiki/posts collections
- How can I show posts with the same tag?