Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This question already has an answer here:

I have pagination on my site like this:

Pages 1 2 3 4

… and so on. I am doing this by adding <--nextpage--> where i want to split my long pages into multiple pages.

I want to add previous and next links to the page numbers that looks like this:

Prev 1 2 3 4 5 6 7 Next

share|improve this question

marked as duplicate by toscho Aug 6 '13 at 8: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.

1 Answer 1

Check out the WP_link_pages function - http://codex.wordpress.org/Function_Reference/wp_link_pages

<?php $args = array(
    'before'           => '<p>' . __('Pages:'),
    'after'            => '</p>',
    'link_before'      => '',
    'link_after'       => '',
    'next_or_number'   => 'number',
    'nextpagelink'     => __('Next page'),
    'previouspagelink' => __('Previous page'),
    'pagelink'         => '%',
    'echo'             => 1
); ?>
share|improve this answer

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