Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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>
                            </section>
                        </article>

                    <?php endwhile; ?>

                    <?php my_paginate_links(); ?>

                    <?php endif; ?>
            </section>
        </section>

    <?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">
        <h3>Home</h3>
        <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>
    </section>
</article>
share|improve this question
add comment

1 Answer 1

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).

http://wordpress.org/support/topic/difference-between-homephp-and-front-pagephp

share|improve this answer
add comment

Your Answer

 
discard

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.