Issues when using the_content() with query_posts()
-
Hi everbody,
I’m trying to create the static page (named HOME) which would have some querried posts on it. When i’m executing code as this one:<?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(); ?>I’m getting only first post from the querry (with all the titles and content) and after that there is a title “HOME”, as the loop is giving back name of the static page and nothing else.
On the other hand when i’m putting 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’m getting all the titles as requested (without any content obviously), and now not sure what is causing the problems.
Any ideas
Thank you
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘Issues when using the_content() with query_posts()’ is closed to new replies.