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.

I have some very long posts, some have more than 50 pages() and when using wp_link_pages it give me 50 internal post links, clearly this isn't usable.

How can I add a range to the wp_link_pages function?

The output should look like this: ...45*6*78...

UPDATE 10/1/2012:

I've got the logic for adding the range but now I need to figure out how to add it to the existing wp_link_pages function?

Here is the example function:

function limitPagination(){
    $displayPages = 5;
    $firstPage = 1;
    $lastPage = $numpages > 5;

    while($numpages > $displayPages){
        if(($pageNow > $firstPage +2) && ($pageNow < $lastPage - 2)){
                echo (($pageNow - 2).($pageNow - 1).$pageNow.($pageNow + 1).($pageNow + 2));
        }
    }
}
share|improve this question
    
Did you ever figure this out? I'm looking for the same thing. –  kel Jun 21 '13 at 17:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.