query_post messed up by the_content

  • Hi,
    I’m trying to make static page with most recent posts from one of the categories.

    So i’ve build page named HOME, with custom template made especially for it. In the template i have :


    <?php
    $args = array(
    'cat'=>8,
    );
    query_posts($args) ?>

    <!-- while funkcja -->
    <?php while ( have_posts() ) : the_post(); ?>
    <!--- ----------- --->
    <div class="sticky-header">
    <h1><?php the_title() ?></h1>
    </div><!-- .sticky-header -->

    <div class="entry-summary">
    the_content()
    </div><!-- .entry-summary -->

    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    and when i run my page what i get is maybe first post from the querry, then below it i got the HOME title and that’s it, no other posts.

    If on the other hand i put something like:


    <?php
    $args = array(
    'cat'=>8,
    );
    query_posts($args) ?>

    <!-- while funkcja -->
    <?php while ( have_posts() ) : the_post(); ?>
    <!--- ----------- --->
    <div class="sticky-header">
    <h1><?php the_title() ?></h1>
    </div><!-- .sticky-header -->

    <div class="entry-summary">

    </div><!-- .entry-summary -->

    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    I’ll get all the page titles as neccessary – i’m not sure but it seems as the_content() mess up the whole querry is there any solution for that?

    p.s. i tried the_excerpt() instead – same results
    regrads

  • The topic ‘query_post messed up by the_content’ is closed to new replies.