wp_query (specific category & user)
-
I am trying to create a simple author.php file that extracts things written by a specific author and from designated categories. I have read on get_posts and it seems that wp_query is what I need to get this effect. However, this code is not doing it for me. It still shows all the users, though it is able to isolate to the right category:
<?php if (have_posts()) : ?> <?php // $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <div class="grid_17 push_7"> <?php /* If this is an author archive */ if (is_author()) { ?> <h2 class="pagetitle hide">Author Archive</h2> <?php } ?> </div> <div class="grid_17 push_7"> <?php $author_id = get_the_author_meta( 'ID' ); //nab the current author id $author_spec = new WP_Query('cat=1', '&author=' .$author_id . '&paged='.$paged); while ($author_spec->have_posts()) : $author_spec->the_post(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_query (specific category & user)’ is closed to new replies.