Does someone have a solution to display only the nextpagelink
with wp_link_pages
in single posts? I’ve tried different solutions, but none of it worked.
As I reach the last page – wp_link_pages
remove nextpagelink
and show previouspagelink
. But I need only nextpagelink at all pages except last one.
Or maybe a solution to add class for nextpagelink?
Found solution:
<?php global $multipage, $numpages, $page;
if( $multipage && $page == $numpages )
{
//Do nothing
} else {
wp_link_pages('before=&after=&next_or_number=next&previouspagelink=&nextpagelinââk=More');
} ?>
You’ll have to prepare your own custom function instead of
wp_link_page
s to use in single.php file of your template.Here’s the custom function
my_wp_link_pages
proposal (contains originalwp_link_pages
code with commented out lines):