The function wp_link_pages() is not working at all in my wordpress template. I have tried all possibilities to make it work. I didn't get any satisfying help for the same online. Please do help me. Guide.
Thanks in advance.
The function wp_link_pages() is not working at all in my wordpress template. I have tried all possibilities to make it work. I didn't get any satisfying help for the same online. Please do help me. Guide.
Thanks in advance.
Use the plugin WP-PageNavi - sample code below:
<?php get_header(); ?>
<!-- Start Loop -->
<?php query_posts('category_name='SomeCategoryName'&orderby=title&order=ASC&paged='. get_query_var('paged')); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php //Loop Code Here ?>
<?php endwhile; else: ?>
<p class="error">No results found.</p>
<?php endif; ?>
<!-- Start Pagination - WP-PageNavi -->
<div id="pagination">
<?php wp_pagenavi(); ?>
</div>
<!-- End Pagination -->
<?php wp_reset_query(); ?>
<!-- End Loop -->
<?php get_footer(); ?>
You should use <!--nextpage-->
for work wp_link_pages
function.
This tutorial will be help to understand how to work <!--nextpage-->
https://www.youtube.com/watch?v=oGFjVx9jDd4
Example: https://codex.wordpress.org/Function_Reference/wp_link_pages#Default_Usage