• Hello all,
    I’m wondering if it is at all possible to make a post loop (specifically, an author’s loop) display after a certain page’s content.

    Specifically, here’s what I want to do:
    I have three pages much like this one that are bios of employees of this particular company:
    http://asiostudio.com/about-asio/bonny-fleming

    And each of these employees contributes to the site by writing posts. What I would like to have is all of that particular author’s posts displaying below their bio page. This loop specifically:
    http://asiostudio.com/author/bonny

    Does anyone know how to go about this, or if it is even possible?

    Any help would be greatly appreciated
    Dylan Fleming

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is definately possible and it shouldn’t be that hard to accomplish. WordPress allows you to have multiple loops on a page, so what you’ll need to do is basically keep the loop that pulls the bio information and add a second loop after that that pulls the posts for that particular person.

    Here’s some information on multiple loops. If you need more help then that, just let me know and I’ll try and help out.

    Thread Starter asiostudio

    (@asiostudio)

    Thank you both for your help! I had to do some rooting about to figure out how to make just that author’s posts show up, but I eventually got it.

    Just in case anyone else has this problem, here’s the code I used to get it all solved. (Keep in mind, we are using a specific template, so you’ll need to adjust your <div> tags if you’re looking to use this code straight.

    <?php
    /*
    Template Name: Bonny Bio
    */
    ?>
    <?php get_header(); ?>
    
    	<?php if (have_posts()) : ?>
    
    		<div id="categorytitle">
    		<?php the_title(); ?>
    		</div>
    
    		<?php get_sidebar(); ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div id="contents" class="twocolumn">
    
    				<?php the_content(); ?>
    
    		<?php endwhile; ?>
    
        <?php rewind_posts(); ?>
    
        <?php query_posts('author=2&showposts=3'); ?>
    		<div id="categorytitle">
    		Bonny's Posts
    		</div>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    				<?php the_content(); ?>
    
    		<?php endwhile; ?>
    	</div>
        <?php rewind_posts(); ?>
    	<?php endif; ?>
    
    		<div class="clear"></div>
    
    	</div> <!-- Close Mainpage -->
    
    <?php get_footer(); ?>

    Again, thank you so much for your help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add Post loop after Page loop’ is closed to new replies.