WordPress.org

Ready to get started?Download WordPress

Forums

Add category to author loop (1 post)

  1. jphogan
    Member
    Posted 1 year ago #

    I am using the following query before the loop to run through author posts and display them with pagination.

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $args = array( 'post_type' => 'post', 'posts_per_page' => 10, 'paged' => $paged, 'author' => $curauth->ID, 'cat' => );
        $wp_query = new WP_Query($args);

    I would also like to include the conditional to only use this query if the category is equal to category 3. How would I add that in the query?

Topic Closed

This topic has been closed to new replies.

About this Topic