You can try this
$args = array(
'post_type' => 'Product',
'orderby' => "name",
'order' => 'ASC',
'posts_per_page' => -1,
'post__in' => $productIds
);
Related Posts:
- How to manage a particular “order by” for get_search_query()?
- Ascending & descending posts on same page with IF statement
- wordpress query – orderby child post date
- Query by one meta_key and sort by another (possibly NULL value)
- Filter query posts by the count of metas for a meta key
- can’t get query to order posts by acf datepicker
- Sorting Grids with Essential Grid and Events Manger
- mySQL query. ORDER BY meta_key
- Order query by post meta value
- Order posts by custom field DATE value
- Ordering by a metadata subfield in WordPress?
- Can’t seem to do combined query AND sort?
- sort query results by newest
- Order by title – but now built in wordpress func, sort the_title
- Querying with WP query using meta key price
- Re-sort get_posts query results
- Order terms by count – missing terms
- How to rearrange a pool of posts joined using two queries?
- How to “orderby” the first array in a meta_query that uses multiply keys?
- Sort query_terms_list for post_tags alphabetically
- JetEngine Query Builder – order by value from repeater
- Custom post type order by post_title
- Orderby event date (if it exists) or post date (if it doesn’t) – how to reorder posts based on meta value OR date
- wp query multiple values > display a specific value first
- Order WordPress Query by Custom Field While Still Using Tax_query Argument
- “order” does not affect order of custom query
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- Query Posts that have or don’t have a meta_value and order by the same ASC
- Apply ordering args to newly merged queried
- Sort loop with query in the link
- WP_Query orderby meta key/value suddely stopped working
- Query posts alphabetically within this function
- Sort posts by category name and title
- Custom query_var causes displaying posts archive on front page
- What is the most efficient way of implementing a favorite post system?
- Order posts by meta_value even if meta_key is not filled
- Query posts from current year
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Query & Sort Comments by custom comment meta
- is_archive() doesn’t work on public query var archive pages?
- How to count get_users query?
- Possible to get posts from multiple meta keys/values in a single query?
- Arrange and separate posts
- Difference between fragment caching and wp_cache
- Meta query with order by another custom field
- Select User by Joining Multiple Meta Value Results
- Show featured image as background image from postQuery
- How do I sort posts with multiple pages
- Using $wpdb->update but confused on the WHERE in and SET
- sort search results by custom fields using dropdown
- You have an error in your SQL syntax – Help with query
- Make one query for adding entries to database
- add_query_arg() and empty variables inside
- Query Strings and Woocommerce
- Style Post Differently In Query
- WordPress post type “event” query string fix?
- How to orderby multiple meta fields if some fields are empty
- order one custom post type by modified time of another post type
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Function to delete a post, it’s children and it’s grand children (half way there already)
- How to sort posts inside categories
- Nested loop : wich way/order?
- Dynamically adjust single-posttype.php query, based on current taxonomies
- Use mysql_query instead of $wpdb query
- Post with certain term and without any term
- Custom Query – Based on user input
- Sort custom posts in archive by multiple values: date AND meta key
- Change the destination of the URLs in post.php
- Page with custom template make get request to a custom route – Pseudo code
- How to exclude posts for current user
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- wp_posts query slowing down my website
- Get the_field of Advanced Custom Fields in a custom query [closed]
- Advanced Custom Fields – Relationship post foreach query
- How do I query for posts by custom meta and those that have been stickied?
- Select min/max meta from query
- orderby ignored by wp_query
- WordPress query unique post meta – finding all of one value without duplicates for a drop down
- Exclude in get_pages() based on meta field
- Sort products by Sale price and stock status
- sort title descending with title with number
- Restore WordPress Backup Locally?
- Trouble migrating custom post types from non-wordpress cms
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Create a new post on a specified publish date via link?
- Exclude Posts from a Widget
- Display three sequential posts on each page load, without repeating previous
- Query String for the WP_QUERY parameters
- $wpdb query for price in custom field value
- Multiple terms not working on taxonomy
- Sorting of coupons in the right way
- excludeCat function reverses order of blog posts
- Run search query again without pagination gives no results?
- Where can I find the SQL to get the most used information by wordpress database?
- WooCommerce Total # orders [closed]
- Query filter on custom post by current author in post widget for elementor query id
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Querying Posts from ACF Repeater Subfield Select Value
- How to sort posts alphabetically based on a specific parent category