Lost in the Loop
-
Hello,
I’m currently quite a bit “lost in the loop”, really ??
On my header.php, I’ve got a loop that displays only the latest post from a category. Works OK!
<?php query_posts('cat=18&showposts=1'); ?> <?php while (have_posts()) : the_post(); ?> <?php the_content(); ?> <?php endwhile;?>
I also have a loop restriction for the following pages (still on header.php): I want two categories to be removed from the loop. Works OK also!
<?php query_posts("cat=-17,-18"); ?>
Then, on my index.php, I’ve got my post listing ~ works OK also…
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
Actually, I would like my single.php to display a single post ~ but I can’t figure out how… Looks like everything has been confused by my loop in the header.php.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
…displays all the entries of course, and not the selected one unfortunately ??Any help / hint ?
Many thanks in advance!
- The topic ‘Lost in the Loop’ is closed to new replies.