In the loop where any of your entries are displayed, you can always display a page switcher.
The number of posts displayed can be edited in the admin panel of yours site.
posts_nav_link
With this function, your navigation will look like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'entry' ); ?> <?php posts_nav_link(); ?> //post_nav_link function <?php posts_nav_link(' . ', 'Prev Page', 'Next Page'); ?> //same function but with parameters <?php endwhile; endif; ?>
Learn more about this function – post_nav_link()
If you want to split the buttons “Next Page” and “Previous Page”
To put these buttons in different places of the template or wrap them in different HTML tags, will help function:
<?php previous_posts_link('Prev link'); ?>
<?php next_posts_link('Next link'); ?>
the_posts_pagination
With this function, your navigation will look like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'entry' ); ?> <?php the_posts_pagination(); ?> // the_posts_pagination function <?php the_posts_pagination(array( 'prev_text' => 'Previous link', 'nex_text' => 'Previous link' )); ?> // the_posts_pagination function can get many parameters, you can read more about them at the link below <?php endwhile; endif; ?>
Learn more about this function – the_posts_pagination()
echo_paginate_links
With this function, your navigation will look like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'entry' ); ?> <?php echo_paginate_links() ?> // echo_paginate_links function, this function can also take many parameters, read more at the link below <?php endwhile; endif; ?>
Learn more about this function – the_posts_pagination()
Now navigation will be turned on for 10 posts on the page (this is a setting from the admin panel), but how to turn on navigation for different numbers of posts on different pages
We talked about navigation for posts page, but there is also navigation for one post that allows you to split it into several parts