Author profile – how to work with several several loops
-
Hello everyone,
I’m working on the author profiles on our website. What I’m trying to do (and partly achieved) is
1. to display the values of several custom fields of the current author,
2. list the three latest posts by the current author,
3. list an unlimted number of pages created by the curretn author.I did get 1. & 2. to work. I do have problems when I try to add another loop. Here is what I have so far.
First loop (recent articles):
<!– The Loop –> <?php if ( have_posts('') ) { ?> <h2>Aktuelle Beitr?ge</h2> <?php } ?> <?php if ( have_posts('') ) : while ( have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php the_title(); ?></a> <?php endwhile; else: ?> <?php endif; ?> <!– End Loop –>
Second loop (pages):
<?php query_posts( 'post_type=page'. '&author=' . $curauth. '&showposts=3' ); // create a new instance of WP_Query $the_query = new WP_Query( $query_args ); ?> <?php if ( $the_query->have_posts() ) : ?> <!-- the loop --> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h3><?php the_title(); ?></h3> <?php endwhile; ?> <!-- end of the loop --> <?php else: ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?>
Right now, after adding the author argument, the author profile page simply cuts off where the loop is supposed show. Not even the footer is displayed anymore.
Can you guys help me out here? THANKS!
Sven
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Author profile – how to work with several several loops’ is closed to new replies.