Title: Linchpin &#8211; PrevNextPage
Author: Aaron Ware
Published: <strong>May 24, 2011</strong>
Last modified: September 6, 2012

---

Search plugins

![](https://ps.w.org/linchpin-next-page-link-previous-page-link/assets/banner-772x250.
jpg?rev=553420)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/linchpin-next-page-link-previous-page-
link_c8d0d8.svg)

# Linchpin – PrevNextPage

 By [Aaron Ware](https://profiles.wordpress.org/aware/)

[Download](https://downloads.wordpress.org/plugin/linchpin-next-page-link-previous-page-link.zip)

 * [Details](https://srd.wordpress.org/plugins/linchpin-next-page-link-previous-page-link/#description)
 * [Reviews](https://srd.wordpress.org/plugins/linchpin-next-page-link-previous-page-link/#reviews)
 *  [Installation](https://srd.wordpress.org/plugins/linchpin-next-page-link-previous-page-link/#installation)
 * [Development](https://srd.wordpress.org/plugins/linchpin-next-page-link-previous-page-link/#developers)

 [Support](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/)

## Description

Create next/previous links for pages. Adds the functions next_page_link() and previous_page_link()
which links sibling to page(s).
 If your page doesn’t have a direct sibling the 
plugin will try to go out to the parent of the current page and get the parent’s
next sibling. If enabled the plugin will also loop from end->beginning and beginning-
>end.

This plugin is great for utilizing WordPress for presentations. If you create a 
set of pages. This plugin will cycle through them. Additionally you could utilize
some javascript to create a timer to automatically go from page to page.

This plugin is based on ‘Next and Previous Page not Post’ by Matt McInvale. Although
it’s gone through almost a complete rewrite from his release in 09. This plugin 
is a bit more optimized to take advantage of newer plugin techniques. Includes code
from banesto as well regarding references to grandparent pages. Also added in additional
features such as $args array for easier customization down the road. This plugin
is great for utilizing wordpress as a presentation tool.

#### See the FAQs Page for Snippets and Examples

## Installation

 1. Manually upload `linchpin-nextprevpage.php` to the `/wp-content/plugins/linchpin-
    next-page-link-previous-page-link` directory on your server (creating the folder
    if necessary. Or utilize the seach and install within the ‘Plugins’ menu of the
    WordPress Admin
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `<?php echo next_page_link(); ?>` or `<?php echo previous_page_link(); ?>`
    in your templates or utilize `[next_page_link]` `[previous_page_link]` shortcode
    or `do_shortcode([previous_page_link])`;

## FAQ

  Examples

Function Options

    ```
    next_page_link( $args:array );
    previous_page_link( $args:array );
    ```

 * ‘label’ => ”, // What ever you want your link to be labeled. If no label is given
   the url is utilized
 * ‘loop’ => NULL, // ‘expand’, ‘loop’
 * ‘getPagesQuery’ => ‘sort_column=menu_order&sort_order=asc’,
 * ‘link_class’ => ”, // class given to the anchor for styling or js library
 * ‘link_id’ => ”, // id given to the anchor for styling or js reference
 * ‘echo’ => ‘true’, //
 * ‘direction’ => ”, // ‘next’, ‘prev’

Function Examples

 * `<?php echo previous_page_link( array ( 'label' => 'View My Previous Page', '
   loop' => 'loop', 'link_class' => 'ui-button-disabled' ) ); ?>`
 * `<?php echo next_page_link( array ( 'label' => 'Next Page' ) ); ?>`

Shortcode Options

 * ‘label’ = ”,
 * ‘loop’ = ”, // ‘expand’, ‘loop’
 * ‘getPagesQuery’ = ‘sort_column=menu_order&sort_order=asc’,
 * ‘link_class’ = ”,
 * ‘link_id’ = ”,
 * ‘direction’ = ”, // ‘next’, ‘prev’

Shortcode Examples

 * [previous_page_link]
 * [next_page_link label=”View My Next Page”]

  Why not use ‘Next and Previous Page Not Post’?

Great question. No reason really. I think this one is a bit more efficient but I
didn’t do an apples to apples comparison. Though this plugin does have a few more
options available regarding customization such as classes and IDs being applied 
to the links if you choose.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Linchpin – PrevNextPage” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Aaron Ware ](https://profiles.wordpress.org/aware/)
 *   [ Linchpin ](https://profiles.wordpress.org/linchpin_agency/)

[Translate “Linchpin – PrevNextPage” into your language.](https://translate.wordpress.org/projects/wp-plugins/linchpin-next-page-link-previous-page-link)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/linchpin-next-page-link-previous-page-link/),
check out the [SVN repository](https://plugins.svn.wordpress.org/linchpin-next-page-link-previous-page-link/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/linchpin-next-page-link-previous-page-link/)
by [RSS](https://plugins.trac.wordpress.org/log/linchpin-next-page-link-previous-page-link/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.2

 * Updated FAQs for easier implementation

#### 1.0.1

 * Fixed a bug where link_class was creating an attribute with no value of the defined
   link_class (EX previous=””) instead of creating value for the class attribute.(
   EX class=”previous”)
 * Fixed a bug where the next and previous links would show even if the current 
   $post ID was the first or last page. This really only applies sites that have
   looping turned off.
 * Minor readme.txt updates just to make things a little bit clearer for first time
   users

#### 1.0

 * Base plugin off of the Next and Previous Page Not Post plugin by Matt McInvale.
 * Optimize plugin’s method for getting the next and previous page.
 * Added more controls for customizing the class and id of each element added.
 * Created a few utility methods to cut down on code duplication
 * Cleaned up short codes to match updated methods

## Meta

 *  Version **1.0.2**
 *  Last updated **14 years ago**
 *  Active installations **20+**
 *  WordPress version ** 3.0 or higher **
 *  Tested up to **3.4.2**
 *  Language
 * [English (US)](https://wordpress.org/plugins/linchpin-next-page-link-previous-page-link/)
 * Tags
 * [next](https://srd.wordpress.org/plugins/tags/next/)[pages](https://srd.wordpress.org/plugins/tags/pages/)
   [presentations](https://srd.wordpress.org/plugins/tags/presentations/)[prev](https://srd.wordpress.org/plugins/tags/prev/)
   [previous](https://srd.wordpress.org/plugins/tags/previous/)
 *  [Advanced View](https://srd.wordpress.org/plugins/linchpin-next-page-link-previous-page-link/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/reviews/)

## Contributors

 *   [ Aaron Ware ](https://profiles.wordpress.org/aware/)
 *   [ Linchpin ](https://profiles.wordpress.org/linchpin_agency/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/linchpin-next-page-link-previous-page-link/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CH9GUS7UQ6SUN)