• I’m having trouble figuring out how to make a Page that simply displays a loop without it double-posting. I’m not sure what the best way to do this is… custom template that is stripped clean and write the loop on the Page itself, or the other way around. I’m getting undesirable results with either method. If I could get some insight as to why I’m getting a “double post” when I use the default template and have only this on my page, I get the content printed twice. Here’s what’s on my Page:

    <?php query_posts($query_string . '&cat=10&posts_per_page=5'); ?>
    			     	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    			  		<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    					<p><?php the_content(__('<span class="moretag">More...</span>')); ?></p><br />
    					<?php endwhile; else: ?>
    					<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    					<?php endif; ?>

    Then I get this:

    https://landofathousandrobots.com/WordPress/city-news-archives-page/

    How do I get the the 3 headings and their content, and not the repeated content below it? I just can’t figure it out. Help is greatly appreciated.

Viewing 1 replies (of 1 total)
  • Thread Starter big blue 802

    (@big-blue-802)

    I should add that this is what my Default Page (page.php) looks like.

    <?php get_header(); ?>
    <br /><br />
    			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    						<?php the_content(); ?><br />
    						<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>
    						<?php edit_post_link( __( 'Edit', 'twentyten' ), '', '' ); ?> 			
    
    <?php endwhile; ?>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Double posting when using custom template’ is closed to new replies.