I’ve got a custom-made theme for my personal site (http://www.mikemorkes.com). The HTML all validates (except one line that comes directly from Twitter). The home page displays correctly – it lists recent posts. However, all pages and single posts display the same listing of recent posts instead of the content that should be there. For instance, ideally, the About page would have a little bio info about me, which I typed in via the admin Pages panel – instead, I get recent posts. I tried commenting out extraneous code from the header, but that didn’t fix it. Switching to a different theme fixes the problem, so it can’t be a corrupt database. It’s like something in my code is breaking the wordpress loop. Any ideas? Here’s the code from page.php:
<?php get_header(); ?> <!-- start of page php --> <div id="content"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="post"><h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?><br /> <p><?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> | <?php the_category(', '); ?> | <?php comments_number('No comment', '1 comment', '% comments'); ?></p></div><br /> <?php endwhile; else: ?> <h2>Woops...</h2> <p>Sorry, no posts were found.</p> <?php endif; ?> </div> <?php get_footer(); ?>
- The topic ‘Page and Single Post Templates displaying recent posts instead of content’ is closed to new replies.