single post on homepage- what’s wrong with this code?
-
At one point I hade my index.php configured to show only one post. Now, after tinkering with it two posts are showing and I cannot figure out what is wrong.
I have tried searching here but didn’t find what I wanted. I have read the loop and query_posts pages on the codex, but I must be missing something because this isn’t working right.
Can somebody spot my error for me, please?
Here’s the code of my index.php
<?php get_header();?>
<div id="main">
<?php query_posts('showposts=1');?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2 class="title">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
<h3 class="date"><?php the_time('F jS, Y') ?></h3>
<!--<h4 class="timestamp">7:35 pm</h4>-->
<?php the_content(); ?>
<h5 class="postmeta"><span class="tags"></span><span class="comments"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></span></h5>
</div>
<!--<?php trackback_rdf(); ?>-->
<?php endwhile; ?>
</div><?php else : ?>
<?php echo "something's gone wrong...";?>
<?php endif; ?><?php get_sidebar(); ?>
<?php get_footer(); ?>
- The topic ‘single post on homepage- what’s wrong with this code?’ is closed to new replies.