Pagination/Infinite Scroll

Hi there,

I’ve checked the forum history and notice that some users have reported the same issue but seems to be unresolved. Basically, my objective is to replace the link “Older Posts” on the main page with Pagination or Infinite Scroll or a nicer navigation menu.

My website is

I’ve managed to trace the “Older Posts” portion to the function in home.php <?php the_posts_navigation(); ?>, which I’ve further traced the details to template-tags.php.

Unfortunately, all attempts to customize this failed:

  1. If I replace <?php the_posts_navigation(); ?> with a custom code, the layout goes haywire
  2. If I try to edit template-tags.php with custom coding, the website doesn’t load

Interesting observations:

  1. Infinite scroll function by Jetpack causes problems with page loading.

  2. Even if I comment out the whole section below in template-tags.php, the main page still shows “Older Posts” at the bottom of the page. I can’t really tell which file/coding that the phrase “Older Posts” comes from.
    function the_posts_navigation() {
    // Don’t print empty markup if there’s only one page.
    if ( $GLOBALS[‘wp_query’]->max_num_pages < 2 ) {
    <nav class=“navigation posts-navigation” role=“navigation”>
    <h2 class=“screen-reader-text”><?php _e( ‘Posts navigation’, ‘sydney’ ); ?></h2>
    <div class=“nav-links clearfix”>
    <?php if ( get_next_posts_link() ) : ?>
    <div class=“nav-previous”><?php next_posts_link( __( ‘Older posts’, ‘sydney’ ) ); ?></div>
    <?php endif; ?>

     	&lt;?php if ( get_previous_posts_link() ) : ?&gt;
     	&lt;div class="nav-next"&gt;&lt;?php previous_posts_link( __( 'Newer posts', 'sydney' ) ); ?&gt;&lt;/div&gt;
     	&lt;?php endif; ?&gt;



After spending a few hours, I’m at my wits end on how to change the navigation menu. Your assistance is much appreciated!

to enable the infinity pagination, you need to make an advance custom code, you can ask codeable to help you :slight_smile: