I want to get posts from a particular category or if the post by a particular user . It seems we could only have AND condition in wordpress . I know the below code is wrong but this is what I need to get - I want all the posts written by a particular user OR all the posts from a particular category
$args = array(
'posts_per_page' => 10,
'offset' => $PageStart,
'query' => array(
'relation' => 'OR', /* <-- here */
array(
'author' => 18,
),
array(
'category' => 20,
)
),
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
);
//print_r($args);
$author_post = get_posts( $args );