WP Link Pages Extended

After

Next the ‘Next’ and ‘Last’ page links are defined, depending on whether or not the current page is the last page. This is basically an inversion of how the ‘First’ and ‘Prev’ links are defined above. Note that the first element added to the ‘after’ array element is the separator, because the standard numeric pagination display does not include one after the last link.

‘lastpagelink’ is not part of the standard definition and is only defined locally.

Next the command to view all the pages as one complete page is added.

The get_pagenum_link() function is called to get the URL of the base page. The preg_match() function checks to use the correct separator depending on whether there are already parameters or if this is the only parameter.

‘viewalllink’ is not part of the standard definition and is only defined locally.

Finally the beginning <p> and <div> elements are closed to finish the display.

The finished ‘args’ array is then returned to the wp_link_pages function and used to create the final pagination navigation display.

Share
The short URL of the present article is: http://www.terryobrien.me/g3w0j

Page 4 of 6
First | Prev | 1 | 2 | 3 | 4 | 5 | 6 | Next | Last
View All