Ending the loop
-
hi,
I am trying to build an editable footer by calling all posts with the category name Footer. I am having problems though as I eiteher get an infinate loop or an error complaining of an unexpected endif or endwhile the code I have at the moment is
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php query_posts(‘category_name=Footer&showposts=1’); ?>
<div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
<p><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></p>
<?php the_content(‘Read the rest of this entry »’); ?>
<p><?php the_tags(‘Tags: ‘, ‘, ‘, ‘
‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
</div><?php endwhile; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>Can someone have a look through and see where I am going wrong. Much apreciated.
Rachel
- The topic ‘Ending the loop’ is closed to new replies.