get products by custom date variable
Try use meta_value instead of meta_value_num. $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 20, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘pa_review_date’, );
Try use meta_value instead of meta_value_num. $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 20, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘pa_review_date’, );
Pagination not working on custom post types with rewrite slug
SQL query – get a featured image’s alt / alternative text
The solution to the issue of slow queries on a site that has a very active comment ‘gang’ (there are over 150K comments on that site, with about 50-100 added each day) (sort of a long answer, but the details might help others): The first step was to ask the hosting company to move the … Read more
Compare ACF date field (if exists) and post date and order DESC
For anyone else that stumbles upon this, @admcfajn posted a comment to my question which solved my problem. Below is the code block found in the commented link, attributed to “danielbachhuber” github user: /** * Include posts from authors in the search results where * either their display name or user login matches the query … Read more
Query multiple post types, but different order for each
Exclude taxonomy Query if post_type
Post incorrectly excluded when using “category__in”?
You can using get_posts(). $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘no-visit’, ‘meta_value’ => ‘true’ ); $pages = get_posts($pages_args); $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( array( ‘key’ => ‘no-visit’, ‘value’ => ‘true’, ‘compare’ … Read more