When using wp_link_pages() to display article pagination, how do I modify the linked class?
I want to use different classes to set the previous/next link style.
Thanks in advance!
Wp_link_pages() parameter:
<?php
wp_link_pages( array(
'before' => '<div class="page-links">',
'after' => '</div>',
'next_or_number' => 'next',
) );
?>
Html output:
<div class="page-links">
<a href="http://test.com/xxxxxx/2/" class="post-page-numbers">PREVIOUS</a>
<a href="http://test.com/xxxxxx/4/" class="post-page-numbers">NEXT</a>
</div>
wp_link_pages_link
filter you can use to modify the class names - in fact, the entire<a>
tag.