Here's the coding for my single.php loop. There are two endifs at the end, but I'm not sure which one needs to go. Seems to generate the same error no matter which one I remove, so maybe it's my structure?
<div id="single_wrap">
<?php while ( have_posts() ) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="stamp_single"><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> | <?php comments_popup_link(
'No Comments »', '1 Comment »', '% Comments »'); ?></div>
<p><?php the_content('<p>Read the rest of this entry »</p>'); ?></p>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
<div class="nav"><?php
$prev_post = get_previous_post();
if($prev_post) {
$prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">« Older posts</a>' . "\n";
}
$next_post = get_next_post();
if($next_post) {
$next_title = strip_tags(str_replace('"', '', $next_post->post_title));
echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Newer posts »</a>' . "\n";
}
?></div>
</div>
<div style="border-bottom:1px dotted #C0C0C0; margin-bottom:10px; margin-left:14px; margin-right:14px; padding:0px
0px 10px 0px; clear:both;"></div>
<?php comments_template(); ?>
<?php endif; ?>
<?php else : ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
</div>