1

Using WP 4.4, if i set my 'max posts' in Settings > Reading = 1 , Reload blog page [which is front page] the page loads infinite 404s

i have this in the start of my format.php

<?php if ( !have_posts() ) { ?>
 <header class="article-header">
  <h1><?php _e( '4Ooops! Couln\'t find that!!', 'tia' ); ?></h1>
 </header>
<?php } else { ?>
 <article id="post-<?php the_ID(); ?>" <?php post_class('cf'); ?> role="article" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting"> + more content

and in index.php

<main id="main" class="cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">

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

<?php  get_template_part( 'post-formats/format', get_post_format() ); ?>

<?php endwhile; ?>

if i set the number to 2, 3, 4, 6 ,7 or others its fine.

But if i set it to 5, then i get the same first 4 posts repeated forever . .

What's going on ?

2
  • Try it with a bundled theme-- one of the "Twenty Something" ones. Do you still see the problem? If you do, start disabling plugins one by one and see if you find one that is causing the problem.
    – s_ha_dum
    Jan 5, 2016 at 3:25
  • it works with the 2016 theme, but im trying to figure out what i did wrong in the theme i am making.. after some research, i see it is the if have_posts call inside format.php, which expects only one post, but dont know why setting to 5 posts made it crazy ...
    – Adeerlike
    Jan 10, 2016 at 20:35

0

Your Answer

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

Browse other questions tagged or ask your own question.