0

Not sure what's happening, but I just took over a site, and no blog posts are rendering on the blog index page. Posts are displaying on the home page but not the posts page. Any suggestions to what this might be? I disabled all plugins - no affect, also checked the database, which seems to be fine: http://ficdn.ca/fit-news/

Index.php

<?php if($blog_post_query->have_posts()): ?>
                        <?php while($blog_post_query->have_posts()): $blog_post_query->the_post(); ?>
                            <?php //get_template_part( 'template-content/content', 'blog' ); ?>
                        <?php endwhile; ?>
                        <?php echo do_shortcode('[ajax_load_more post_type="post" posts_per_page="5" scroll="false" transition="fade" button_label="Older Posts"]'); ?>
                    <?php else: ?>
                        <?php get_template_part( 'template-content/content', 'none' ); ?>
                    <?php endif; ?>

blog.php

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title">
    <?php if(!is_page('public-policy')) the_title(); ?>
</h2>
<p><?php post_info(); ?></p>
<div class="entry-content">
    <?php the_post_thumbnail('large'); ?> 
    <?php the_content(); ?>
</div><!-- .entry-content -->

1
  • The html output of provided link contains a <h1> tag after the <article>, but your code contains a <h2> tag. Are you sure you are investigating the proper php file?
    – Johansson
    Jan 18, 2017 at 22:05

1 Answer 1

0

Your index.php is calling a template part (template-content/content-blog.php), which logically should contain the post content, but it's commented out.

Change:
<?php //get_template_part( 'template-content/content', 'blog' ); ?>

To This:
<?php get_template_part( 'template-content/content', 'blog' ); ?>

See if that helps.

1
  • Ah, thank you. Can't believe I didn't notice that. Cheers.
    – bgilbank
    Jan 19, 2017 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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