<?php get_header(); ?>
<?php get_sidebar(); ?>

<div id="contentcontainer">

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<div class="blogbefore"></div>
<div class="blog"><div style="overflow: hidden;">
<h3><a href="<?php the_permalink(); ?>" title="Permalink for <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<p class="headertext">Posted on <?php the_time('F jS, Y'); ?> by <?php the_author(); ?>. <?php edit_post_link('edit.'); ?><br />Categories: <?php the_category(', ') ?>.</p>
<?php the_content(); ?>
<?php if(!is_single()) { ?><p class="footertext"><?php comments_popup_link('0 comments.', '1 comment.', '% comments.' ); ?></p><? } else { ?><p class="footertext"><?php comments_number(__('0 comments.'), __('1 comment.'), __('% comments.')); ?></p><?php } ?>
</div></div>
<div class="blogafter"></div>

<?php comments_template(); ?>

<?php endwhile; else:  ?>

<div class="blogbefore"></div>
<div class="blog">
<h3>There are no blogs relating to your query.</h3>
</div>
<div class="blogafter"></div>

<?php endif; ?>

<?php if(!is_single()) { ?>
<div class="blogbefore"></div>
<div class="blog"><div style="overflow: hidden;">
<p>
<span class="right"><?php posts_nav_link('','','Older &raquo;') ?></span>
<span class="left"><?php posts_nav_link('','&laquo; Newer','') ?></span>
</p>
<p class="clear"></p>
</div></div>
<div class="blogafter"></div>

<?php } else {} ?>

</div>

<?php get_footer(); ?>