Posts by Category and Author
-
I’m trying to show a list of posts by an author on the author’s profile page (authors.php template). I’ve come up with this much
<?php $recent = new WP_Query("cat=5&author=<?php the_author_meta('ID'); ?>"); while($recent->have_posts()) : $recent->the_post();?>
to begin the loop, which is how all other loops on our site are set up. The only thing that doesn’t seem to be working is the call to author id. I’m using the same method to call the author ID outside of the loop.Is there a way to display posts from a specified category from only the author of the page that this loop appears on? I’ve searched the forums for a while and that’s how I found the author= help, but they only say to use author= with the specific ID number…
- The topic ‘Posts by Category and Author’ is closed to new replies.