How to Join wp_posts & wp_postmeta table using custom query
How to Join wp_posts & wp_postmeta table using custom query
How to Join wp_posts & wp_postmeta table using custom query
I will start with this, never pass raw variables to a sql query! unless you have 100% control over the variable content, and even then I would still not pass it raw. Always use prepare(). Now going by your need you will need to do something like this <?php $paged = (get_query_var( ‘paged’)) ? get_query_var(‘paged’) … Read more
Customize the Sorting Dropdown in WooCommerce use another list or more page
How to combine meta_query and date_query with condition in WordPress
Sort custom post by custom field if none order by latest release
create a custom query for posts managed by Restrict Content Pro
So, I actually fixed the issue by reversing the order of the OR conditions. If anyone knows why this fixed it, I’d love to know. $next_event = get_posts( array( ‘post_type’ => ‘event’, ‘post_status’ => ‘publish’, ‘numberposts’ => 1, ‘fields’ => ‘ids’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_post_date_year’, ‘value’ => $year, ‘compare’ … Read more
Sending simple variable on single page to WP JSON
Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
How to add a “base” filter for all posts visible to visitors on the site?