Support » Themes and Templates » Help with a multiple loop

  • Was wondering if someone can point me in the right direction.
    I am trying to display the page information and post information on the same page. The problem is, I would like the paginate the post info.

    <?php
    /*
    Template Name: Template Blog Page
    */
    ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php if ($pagename=='test-page') : ?>
    
    		<p><?php the_title(); ?></p>
    		<p><?php the_content(); ?></p>
    		<hr />
    
    	<?php $newQuery = new WP_Query('category=general&showposts=3'.'&paged='.$paged); ?>
    		<?php if ($newQuery->have_posts()) : while ($newQuery->have_posts()) : $newQuery->the_post(); ?>
    
    			<p><?php the_title(); ?></p>
    			<p><?php the_excerpt(); ?></p>
    			<hr />
    
    		<?php endwhile; ?>
    
    			<div class="navigation">
    				<div><?php next_posts_link('&laquo; Older Entries') ?></div>
    				<div><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    			</div>				
    
    		<?php endif; ?>
    
    	<?php endif; ?>
    <?php endwhile; endif; ?>
  • The topic ‘Help with a multiple loop’ is closed to new replies.