Hi there,
I have a problem with the pagination of my posts on my static homepage. When I click on page 2 on the homepage, it doesn’t go to the 2nd page and stays on the 1st postpage. But the url becomes /page/2
This occurs only when it is a static homepage. But not when it is a postpage.
I am using Maxblog theme and the website is: mrsagel.com
I looked everywhere on the internet and tried a lot of codes, but nothing did help. I need some specific code for my theme.
I think that I have to change the code in index.php but I am not sure:
<?php
/**
* The Template for displaying all single posts
*
* @package WordPress
* @subpackage Maxblog
* @since Maxblog 1.0
*/
?>
<?php get_template_part(“template-parts/blog”,”before”); ?>
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( ‘template-parts/content’ );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) : comments_template(); endif;
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination( array(
‘prev_text’ => wp_kses( __( ‘<i class=”fa fa-angle-double-left”> </i>’, “maxblog” ), array( ‘i’ => array( ‘class’ => array() ) ) ),
‘next_text’ => wp_kses( __( ‘<i class=”fa fa-angle-double-right”> </i>’, “maxblog” ), array( ‘i’ => array( ‘class’ => array() ) ) ),
‘before_page_number’ => ‘<span class=”meta-nav screen-reader-text”>’ . esc_html( ‘Page’, “maxblog” ) . ‘ </span>’,
) );
// If no content, include the “No posts found” template.
else :
get_template_part( ‘template-parts/content’, ‘none’ );
endif;
?>
<?php get_template_part(“template-parts/blog”,”after”); ?>
I hope that someone could help me.
Thanks a lot.
Grtz