WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the below code in front-page.php (with that page set in Settings > Reading); however, something is wrong because the posts aren't showing. The output is shown below. Can someone identify what the problem may be?

    <?php get_header();?>

        <section id="home-content">
            <section id="latest-news">
                <h2>Latest News</h2>

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

                        <article class="entry" id="post-<?php the_ID(); ?>">
                            <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
                            <section class="description">
                                <h3><?php the_title(); ?></h3>
                                <time datetime="<?php the_time('c'); ?>"><?php the_time('F d, Y'); ?></time>
                                <?php the_content(); ?>
                                <p class="post-categories">Categorized under: <?php the_category(', '); ?></p>
                                <a class="read-more" href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title_attribute(); ?>"></a>

                    <?php endwhile; ?>

                    <?php my_paginate_links(); ?>

                    <?php endif; ?>

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

The code above outputs the html below. Note: "Home" is a page, not a post.

<article class="entry" id="post-1048">
    <section class="description">
        <time datetime="2012-08-29T06:38:44+00:00">August 29, 2012</time>
        <p class="post-categories">Categorized under: </p>
        <a class="read-more" href="http://site.com/" rel="bookmark" title="Read Home"></a>
share|improve this question
up vote 1 down vote accepted

Turn your Settings->Reading Blog and Home page back to default. Front-page.php is pulling your homepage content instead of your posts because you've told it to in your settings.

front-page.php could also display the latest posts on your homepage, but if you've altered the settings so that a Static Page is your homepage then this file would be used to display that (assuming you haven't given that page a specific page template file to use).


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.