WordPress posts loop not displaying all posts on blog
Question
I’m a beginner developer so I’m sorry if I’ve made some obvious mistake, but I simply don’t get why my loop for posts is not displaying all of my posts, I created 14 test posts and set the Reading options in WordPress to display latest posts and put the number to 10, however, only 5 posts appear on the first page and when I click on 2nd page in the pagination there’s only 1 post and my footer goes all the way up to the end of the post box instead of staying down on the 2nd page.
<?php get_header(); ?>
<div class='containter containter--narrow page-section'>
<?php if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" class='post-item'>
<h2><a class="post-title headline headline-medium" href='<?php the_permalink(); ?>'><?php the_title(); ?></a></h2>
<hr>
<div class='metabox'>Author: <?php the_author_posts_link(); ?> Published on: <?php the_time('d/M/Y'); ?> Categories: <?php echo get_the_category_list(', '); ?></div>
<div class="post-excerpt content">
<?php the_excerpt() ?>
<p><a class='read-more' href="<?php echo get_permalink(the_post()); ?>">Read More »</a></p>
</div>
</article>
<?php endwhile;
endif;
echo paginate_links(); ?>
</div>
<?php get_footer();
?>
0
loop
3 years
2020-04-03T12:52:08-05:00
2020-04-03T12:52:08-05:00 0 Answers
74 views
0
Leave an answer