Skip to main content
edited tags
Link
Chip Bennett
  • 55.1k
  • 8
  • 90
  • 170
Source Link

Wordpress: Loop Help

I was working on this site this morning and I ran into a bit of an issue with my static page.

I have a "featured" post section and I use:

<div id="featured">
    <img src="<?php echo get_bloginfo('template_directory'); ?>/images/house.jpg" alt"Buy Me" />

    <div class="info">
     <?php query_posts(array ('tag'=> 'featured' )); ?>
    <?php while (have_posts()) : the_post(); ?>
            
    <h1><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h1>
    <p><?php the_time('F jS, Y') ?> by <?php the_author() ?></p>
    <?php endwhile; ?> 

    </div>

</div>

The above works great, however, the page content is where I am running into an issue. I have a content section that is pulling in the "pages" actual content, and I use:

<div id="about">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

            <h2><?php the_title(); ?></h2>

            
            <div class="entry">
                <?php the_content(); ?>
            </div>

            
        </div>

    <?php endwhile; ?>

    <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>

    <?php else : ?>

        <h2>Not Found</h2>

    <?php endif; ?>


</div>

When I refresh the page, both of the sections are now displaying the featured post, and not the the page content. Does anyone have a clue to why this is happening?