How to find a post using XML-RPC without knowing ID
How to find a post using XML-RPC without knowing ID
How to find a post using XML-RPC without knowing ID
The category parameters does not work with custom taxonomies. You need to use a tax_query instead. In your current code, replace (which is in any case also wrongly used, category_name takes the slug, not name) ‘category_name’ => $category->name with ‘post_type’ => ‘case-studies’, ‘tax_query’ => array( array( ‘taxonomy’ => $tax ‘terms’ => $category->term_id, ‘include_children’ => false … Read more
The custom query to get custom post type posts filtered by 2 different terms from 2 different taxonomies will be: $args = array( ‘post_type’ => ‘listing’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘job_listing_region’, ‘field’ => ‘slug’, ‘terms’ => ‘himalyan’, // this can be an array of terms also ), array( ‘taxonomy’ => … Read more
Query if audio attachment AND/OR custom field
Pagination with an array of post objects?
try to use a new WP_Query, when you use get_posts you’re using the main WP_Query this has hooks that other plugins can use to alter the query. something else i saw is that you’re using include key which is not valid $my_query = new WP_Query( array( ‘post__in’ => array( 1633, 1634, 1635 ), ‘post_status’ => … Read more
How to get post content by get_posts function?
Query to only return the 2 newest post attachments (images)?
‘exclude’ argument is not working with get_posts for a custom post type
$posts is a reserved global variables which stores the value from the $posts property from the main query. By using $posts as a local variable, you are breaking the main query and the $posts global variable. This leads to unexpected output. You should use unique custom variables as local variables. You can solve your issue … Read more