WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Tenth post falling outside of loop. (3 posts)

  1. robertm344
    Member
    Posted 2 years ago #

    I am currently developing a custom theme for a client. I have multiple pages using different loops that display posts from a certain category. All was going fine until I hit the tenth post in one of the categories. I have the loop nested in a div id="content". When the tenth post is displayed it displays outside of this div.

    I have the "Settings < Reading < Blog pages show at most" set to 25.

    The code for the template file itself is as follows:

    <?php
    /**
     * Template Name: Team Page
     *
     * This is used for any page with team content.
     *
     * @package WordPress
     * @subpackage Hospitality Development Group
     */
     get_header(); ?>
    	<div id="main" class="team">
    		<div id="content">
    			<h1><?php the_title();?></h1>
    			<?php get_template_part ( 'loop', 'team');?>
    		</div><!--content-->
    	</div><!--main-->
    	</div><!--live_area-->
    	<?php get_footer(); ?>

    The code for the loop is as follows:

    <?php query_posts('category_name=team&order=asc'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post clear">
    	<h2><?php the_title(); ?></h2>
    	<?php global $more; $more = 0;?>
    	<?php the_content('Learn More'); ?>
    </div>
    <?php endwhile;?>

    Any ideas of what might cause this?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the error could be in the content of the tenth post, or in any of the posts.

    try and see if the results of a validation check might give you a hint: http://validator.w3.org/

    if you want to have some assistance with finding the cause of the problem, please post a link to your site, with ten posts and the problem evident.

  3. robertm344
    Member
    Posted 2 years ago #

    You, my friend, hit the nail on the head. The previous post was missing a single quotation mark. Thank you for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic