0

This question already has an answer here:

In a single page, I split long post by nextpage and shows pagination number or next/previous option.But I want to display both number and next-previous option. Here is my single page screenshot one is next-previous and another is number option.And My code is that:

function custom_nextpage_links($defaults) {
                 $args = array(
        'before'     => '<ul class="my-paginated-posts"><ul><li>' . __( 'Section:', 'textdomain' ),
    'after'            => '</li></ul>',
    'link_before'      => '<span class="page-link">',
    'link_after'       => '</span>',
    'separator'        => ' ',
    'nextpagelink'     => __('Next &raquo', 'textdomain'),
    'next_or_number'   => '',
    'previouspagelink' => __( '&laquo Previous', 'textdomain' ),
    'pagelink'         => '%',
    'echo'             => 1
);    

$r = wp_parse_args($args, $defaults);

return $r;
}
add_filter('wp_link_pages_args','custom_nextpage_links');

enter image description here

enter image description here

marked as duplicate by Michael, Max Yudin, cjbj, Dave Romsey, Howdy_McGee Apr 26 '17 at 21:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

If next/prev posts exist, the next/prev button will show. What i did here is to modify the next/prev labels :)

while( have_posts() ) :
  // Your loop
endwhile;

// Pagination
$pagination_args = array(
  'prev_text' => '<i class="fa fa-chevron-right" aria-hidden="true"></i>Previous post',
  'next_text' => 'Next post<i class="fa fa-chevron-left" aria-hidden="true"></i>' ); ?>
<div class="paginate_container"><?php echo paginate_links( $pagination_args ); ?></div>

Not the answer you're looking for? Browse other questions tagged or ask your own question.