Sorting with meta_query and multiple, optional meta keys
Sorting with meta_query and multiple, optional meta keys
Sorting with meta_query and multiple, optional meta keys
One thing that can be happening is if you have added a Read more tag in your content it is overriding the manual excerpt. just check and see if you have <!–more–> tag in your content body. if so remove it. The next thing is the_excerpt()may use auto generated excerpt. it is said in Wp … Read more
As stated above, your orderby parameter should be set to meta_value, not restaurant. Using phpMyAdmin or some other tool, look at your database. With any newer installation of WordPress, your tables should have a collation of utf8mb4_unicode_ci. That means that the table is storing its data in UTF-8 4-byte unicode character set. That “ci” at … Read more
I continued to research my issue and ended up finding the solution here: I need query_posts() to order results first by a meta value and then by post ID Basically, it seems the WordPress orderby is screwed. When I examined the SQL it was producing the orderby looked like this: ORDER BY wppc_postmeta.meta_value+0 DESC Which … Read more
It can be done, but it won’t be so easy. Post Object is stored as an ID, so you can’t use meta query to search by post title in such case… There are few ways of solving that problem: 1. Use acf/save_post action to save title of given post object as another meta value: // … Read more
With the guidance of @jacobPeattie below is the working example. Once I removed the commas everything was working great. I added number_format to the deal amount to automatically add the commas on the frontend. <?php $transaction = new WP_Query( array( ‘post_type’ => ‘transactions’, ‘paged’ => $paged, ‘posts_per_page’ => 50, ‘orderby’ => array( ‘meta_value_num’ => ‘ASC’ … Read more
How to query for exact string in custom field?
How can I query a radius of coordinates?
Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?