phgDigital / Project

1 stars 1 forks source link

Figure out the Static vs. Listing home page options/templates #19

Closed chrisblakley closed 7 years ago

chrisblakley commented 7 years ago
screen shot 2017-07-19 at 12 20 00 pm

I'm not sure if that is working yet. Let's make some posts and see if we get a listing.

chrisblakley commented 7 years ago

The blog homepage only appears to show one post. It does not use any particular template (so, not single.php). The blog class appears in the body if that helps at all.

It is still using front-page.php. Ok, actually it replaces the_content() from the front page template with a post listing (from somewhere). No titles are appearing, though.

chrisblakley commented 7 years ago

Ok, this is all set now.

<?php if ( get_option('show_on_front') == 'posts' ): //"Your latest posts" ?>
    <?php get_template_part('loop', 'index'); ?>
<?php else: //"A static page" ?>
    <?php if ( have_posts() ) while ( have_posts() ): the_post(); ?>
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <div class="entry-content">
                <?php the_content(); ?>
            </div>
        </article>
    <?php endwhile; ?>
<?php endif; ?>