If you’re trying to get them to order by ascending price, the problem is that ordering by title is a string comparison, not numeric. A solution would be to put the price in a custom field and orderby your custom field rather than title. You would add a meta_key
param with the name of your meta key, and orderby meta_value_num
. See WP_Query in Codex for more info.
Also- if you want all posts returned (which I assume is what you’re trying to do with setting it to such a high number), you can set posts_per_page
to -1
instead and it will remove the LIMIT
clause from the query.
Related Posts:
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_QUERY Get posts by category and similar name (Like)
- Using get_posts vs. WP_Query
- Way to include posts both with & without certain meta_key in args for wp_query?
- How to Access Global $multipage or Global $numpages outside the loop?
- Custom archive page based on array of categories and tags
- How can I connect to another WP database and use WP_Query?
- Custom page template query_vars
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- Why does “Blog pages show at most” interfere with my custom wp_query?
- Recommended way to drop a pending query (in pre_get_posts)?
- How to search for posts IN OR title OR content OR author?
- WP_Query class not found
- Search – Ajax – Alter Query Parameters with Pagination
- Access to Instance Variables from WP_Query
- WP Query with multiple categories – passing an array works?
- Order by menu structure
- Custom query, works, but I get a “Notice: Undefined offset: 0…”
- SQL User Query by Multiple Roles using PHP
- how to speed up a complex wp_query?
- How to capture a variable query string, then append it to all URLs in a WordPress site
- Exhausted memory limit with very simple WP_Query
- WP_Query doesn’t get sticky post at the top, when used in a page template
- What’s faster? One big query, or several smaller ones?
- Select from wp_post and multiple meta_value from wp_postmeta
- Multiple Loops Inside a Function
- Sort users by “birthday” using WP_User_Query
- Overwriting posts_per_page in new WP_Query
- How to use WP_Query without breaking the main Query
- How to use MySQL’s MATCH AGAINST in WP_Query?
- Ajax Pagination on Ajax filter
- Wp_query returning only one post while query through ajax
- only delete post within query / for each statement (front end)
- Database Queries Optimization with new WP_Query
- How to optimize multiple WP_Query() calls on one page?
- How to make “Blog pages show at most” setting not affect custom queries
- category query for pages not working
- Bypass “supress_filters” in WP Query
- date_query on draft posts only
- Order ascending is ignored in meta query?
- How to get list of posts from permalinks?
- WP Query – Post Thumbnail
- How to change main query to only query posts from a single category? [duplicate]
- Pagination for blog posts reloading same page [closed]
- wp_query not working with post_type
- Individual months in WP Query
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- post_parent don’t work and return 0 page
- date_query in pre_get_posts out of memory
- Combine 2 WP_queries into one (OR relation)
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- Link Author URL’s based on a custom field
- How to set parameters for search loop?
- Get posts with no tags?
- get_posts query matches too many results
- Sort by custom field that is an array?
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Related posts by current posts child category
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- duplicated posts when using pagination
- How to use the Term Object from a custom select field in a query
- Random users always showing same 8 users
- meta_query order by date present -> future then show null
- Wp-query and column blocks
- How to upload 3 attachments to current post?
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Sort posts on custom field AND after that sort on date?
- Get last child of given page by ID
- How to query users by post count no less than 10
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- Paginated Author.php not using Author.php template
- Help displaying related categories
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- Display First posts without the default featured image
- Hierarchical List Pages as a table
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- query_posts, oderby meta_value & print “future” posts
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- wp_query loop with compare operator simply not working, why?
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Display only posts with thumbnails