Query Question. How to show posts from specific author
-
Hello all-
I’m trying to do a query where only the admins posts are shown.
My ultimate goal is to have the admins post shown in its own loop and all other authors shown in another on the same page.
But first things first. I can’t get the query/loop to show just the admins posts.
Here’s what I have:<?php if (have_posts()) : ?> <?php query_posts('author=1&numberposts=4'); ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <small>Viewed <?php the_view_count(); ?> Times</small> <span id="l_writtenby">by <span id="l_author"><?php the_author(); ?></span></span> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here. <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?>
Any Suggestions are greatly appreciated
Thanks
-Landon
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Query Question. How to show posts from specific author’ is closed to new replies.