What’s missing in this wp_query and meta_query
The meta query is converted by _get_meta_sql(). You can check the output by hooking into get_meta_sql. Dump that value and see what it gives.
The meta query is converted by _get_meta_sql(). You can check the output by hooking into get_meta_sql. Dump that value and see what it gives.
Looking at your code it looks perfectly fine. Although the more complex you make your query the more resources it is going to take and the longer it is going to take. You mention that your CPU usage rises to 80% which would be normal but how long is the usage holding at 80%? If … Read more
Though it might take some tweaking you can use the ‘orderby’ parameter on multiple values. The difficulty here is more in terms of logic, for example July 3 (date value) and the number 10 (meta value) do not really relate to one another, this would cause problems if not formatted correctly. You best bet is … Read more
Would it be better to ditch the JS formatter on the input fields in the admin and instead add the dollar sign and comma separation on the front end? Yes, definitely. This seems more logical, but then it raises another question of how to prevent a user entering a dollar sign or comma formatting in … Read more
I think you’re using wrong keys for meta_query array, also it expects nested arrays, even if you only have one query. Code below should help. $args = array( ‘meta_query’ => array( array( ‘key’ => ‘is_url’, ‘value’ => ‘yes’, ‘compare’ => ‘NOT LIKE’ ) ), );
I believe the problem is that you are using single quotes in passing values to query (e.g. ‘value’ => ‘$bedrooms’), but this way the variables are not expanded (see http://php.net/manual/en/language.types.string.php). Simply use ‘value’ => $bedrooms.
Several things, Firstly you can add the following for pagination: ‘paged’ => ( get_query_var(‘paged’) ? get_query_var(‘paged’) : 1 ) This removes the need for the array_merge. Otherwise your existing code is fine except for some indentation. I would add the rest of the query though, e.g. defining the post type, the posts per page, etc
Untested solution, just a thought really, but what if ‘value’ => ‘NOW()’ so that you avoid having to pass the date, which seems like it’s probably the issue? EDIT Alternate solution: Your SQL date format is wrong. It should be $todaysDate = date( ‘Y-m-d’ ), that should also be the format it is stored in … Read more
This is a complex answer, more than can really be answered in a post here. However, you can take a look at this tutorial – I’ve done something similar, and his post is very thorough: jQuery UI Sortable Tutorial
You can certainly use the Advanced Fields plugin for this type of functionality – you’ll just need to add a few lines to the query that creates your custom pages. I found the documentation on checkboxes from ACF to be helpful. Scroll through the code examples at the bottom of the page and you’ll see … Read more