• I created a separate php file for a part of a template I wanted to display in the header, but the query brings up posts all down the page and I was wondering how I would stop that????

    Here is my code:

    <?php
    /**
    * Template for Events Header
    */
    ?>

    <div class=”right”>
    <h1>UPCOMING EVENTS</h1>
    <?php
    query_posts(array(
    ‘post_type’ => ‘events’,
    ‘showposts’ => 4
    ) );
    ?>
    <?php while (have_posts()) : the_post(); ?>
    <h2>“><?php the_title(); ?></h2>
    <p><?php echo get_the_excerpt(); ?></p>
    <?php endwhile; ?>
    </div>

    It was really simple and works beautifully, but I can’t stop it from bringing posts from teh custom post type and placing them were the main posts are supposed to be. Can anybody help me?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Stop Custom Post Query?’ is closed to new replies.