Next Page, Not Next Post – WordPress Plugin

next-page-not-next-post

Download Next Page, Not Next Post at WordPress.org

Out of the box WordPress does a magnificent job of handling navigation between next & previous posts. It doesn’t do too great of a job handling navigation between sibling pages. We needed a solution to allow users to easily switch between these pages. After much searching and testing, it was clear that there wasn’t a good solution to this dilemma.

Our first “official” WordPress plugin “Next Page, Not Next Post” handles that without too much trouble.

An example solution

  • Home
  • About
    • Team
      • A
      • B
      • C
      • D
      • E
      • F

When a user is viewing page B, we create links to A & C. When on C, they get B & D and so on.

This plugin gives you two new functions, next_page_not_post($anchor_text, $loop, $getPages) & previous_page_not_post($anchor_text, $loop, $getPages). Each function has three simple options.

  1. Anchor Text – Either set the anchor text manually or use the page title. %title will be replaced with page title. Defaults to page title, just leave blank for that.
  2. Looping - Link the first element to the last and the last to the first, or not. Set this parameter to ‘expand’ and the plugin will descend into child pages and ascend into parent pages when needed. This is useful for creating a simple click-thru interface with multiple levels. Set to ‘cousins’ or ‘cousinsloop’ to click through pages with a similar grandparent. Defaults to not looping (set to false or NULL), set to true for looping.
  3. Get Pages – This is used with WordPress’s get_pages() function to determine the order of your pages. Defaults to menu_order and ascending.

It’s as simple as echo’ing the functions in your page:

<?php echo next_page_not_post(); ?>
<?php echo previous_page_not_post(); ?>

You can get more complex with this if needed in your templates. Setup a variable and then check if it’s empty to display more complex HTML. Maybe something along these lines?

<?php
 $nextPage = next_page_not_post('Next Page', 'true', 'sort_column=post_date&sort_order=desc');
 $prevPage = previous_page_not_post('Previous Page', 'true', 'sort_column=post_date&sort_order=desc');

 if (!empty($nextPage) || !empty($prevPage)) {
 echo '
<ul id="nextPrevPages">';

 if (!empty($nextPage)) echo '
 <li class="next">'.$nextPage.'</li>
';
 if (!empty($prevPage)) echo '
 <li class="previous">'.$prevPage.'</li>
';

 echo '</ul>
';
 }
?>

Shortcodes

Just added 2 shortcodes to help users that aren’t able to edit their theme files. The two shortcodes are [ next_page ] and [ previous_page ]. Each supports 3 attributes: anchor, loop and getPagesQuery. Each attribute should function the same as the function documentation above.

Let us know if this plugin works for you or you have any ideas for improving it.

Special thanks to Sarah & Frodo for help with testing.

History

  • 0.1.8: Added ‘cousin’ & ‘cousinloop’ to the looping options, development sponsored by Funkhaus Design 
  • 0.1.7: Fixed grandparent ascension in expand looping and added %title to anchor parameter
  • 0.1.6: Added shortcodes
  • 0.1.5: Added title attribute to links
  • 0.1.4: Added the ability to ascend and descend into parent/child pages.
  • 0.1.3: Replaced the manual sort option with more robust, $getPages option.
  • 0.1.2: Added the ability to manually sort.
  • 0.1.1: Updated plugin to work with “ugly” URLs.
  • 0.1: We’re still in early development with this plugin. There are bound to be some bugs and improvements we can implement.

234 Responses to Next Page, Not Next Post – WordPress Plugin

  1. Pingback Next Page, Not Next Post – WP Plugin Archive

  2. May 1, 2009 Inge

    How about following menuorder?

    • May 1, 2009 mcinvale

      Thanks for the suggestion, I’ll update the plugin later today.

  3. May 28, 2009 Wisam

    Excellent plug-in. I’ve been searching for this for quite some time!!
    Works out of the box and I already implemented it in my website to present the categories as chapters in a book. However, when I reach the end of a category (the last page) I want the next page to be the first page of the next category (parent or group) and keep going. Previous would do the opposite. Currently, the plug-in loop through the same group. Is it possible to have the plug-in move to the next parent?
    Here is an implementation of the plug-in:
    http://www.marcilan.com/pathology/cysts/lateral-periodontal-cyst/

    and second question, how do I integrate « to show up only before the title in the previous page and integrate » to show up only after the title of next page?

    Thanks!

  4. May 28, 2009 mcinvale

    Wisam, we’re happy you like our plugin. :)

    “Is it possible to have the plug-in move to the next parent?”

    This goes well outside the intended functionality of this plugin. It wouldn’t be extremely difficult to make this happen though. Shoot me an email and we can discuss this, mcinvale@binarym.com.

    “how do I integrate « to show up only before the title in the previous page and integrate sta to show up only after the title of next page?”

    I don’t understand exactly what you’re asking here? Can you give me more detail(s)?

  5. June 14, 2009 Kevin Goldman

    Thanks! Works great.

  6. June 15, 2009 Wisam

    Now it is working like a charm. Thanks mcinvale for your help. I really appreciate it!!

  7. June 17, 2009 Tilkitiki

    Thanks for this plugin. I would like to ask how could I disable looping? Although it was indicated that by default it does not make looping it seems that it is working.

    The structure is:
    A
    -B
    –C
    –D
    –E
    –F
    -G
    –H
    –I
    –J

    I use your plugin to navigate between C,D,E,F & H,I,J.
    When I am at “C”, I still have the link to “F” as previous page. Idem, when I am at “F”, “C” appears as the next page.

    Thanks,

    Best regards,

  8. June 17, 2009 mcinvale

    Leave the loop parameter blank or set to false and it shouldn’t do that.

    • February 10, 2010 tschutter

      I have the exact same problem as mentioned above. It seems that it keeps looping, even when I leave the loop parameter blank or set it to false.

      What could be a solution to this?

      • February 10, 2010 tschutter

        I found the problem. The looping only happends with your 2nd example code. The 1st example code example works fine!

        Thanks for the great plugin.

    • June 7, 2010 Alex Glover

      It does not seem to honor the false set in no looping.. even though I have set it. The idea I need it for is that the link doesn’t display if there is not a next/previous item.

      • June 7, 2010 Matt McInvale

        can you post a link to the pages that you’re using this on? i’m not aware of any bug that would cause this to not function correctly.

        • June 7, 2010 Alex Glover

          It is currently a password protected page.

          • June 7, 2010 Matt McInvale

            i can’t debug what i can’t see ;)

          • August 3, 2010 David

            I had this problem with the second script still showing the next/previous links when the parameter was set to false.
            To fix it I downloaded the latest version and replaced the code in the plugin (1.6 from the paste bin – 3 August)
            Then I used:

            I then wrapped those divs in an outer div
            And floated the div#prev-link left and the div#next-link right.

            Hope it helps somebody.
            Plug-in works a treat in WP3.0.1

          • August 3, 2010 David

            sorry it seems the code was stripped from my previous message:

            
            
          • August 3, 2010 David

            Darn it.

            Here is a link
            http://pastebin.com/7pzEhdAN

  9. June 17, 2009 Web Design San Diego

    You have no idea how long I was searching for a way to make my pages (not posts) show the previous – next!

    Your plug-in does it perfectly, and I can even sort it the way I want to! Thank you so much! It works on the website for the San Diego Ballet http://www.sandiegoballet.org now, if anybody is interested to see it working, go to the about/dancers/company dancers/individual dancers pages, you can nicely jump from one dancer to the next now thanks to this great plug-in.

    Thanks again, I really appreciate it!

  10. September 8, 2009 Ryan

    Just fantastic – thanks for this excellent plugin.

  11. October 28, 2009 Matt Hill

    Very cool! I’ve been bashing my head trying to solve this for the last couple of hours. Then I found your plugin. I should have Googled first, would have saved me a lot of time.

    Many thanks for the plugin, it’s working great for me.

  12. November 7, 2009 Rasmus

    Great plugin – works perfect as intended. One quetsions though – I would like to have the title attribute implemented also. So besides the anchor text it also shows the title attribute. Like:
    next page anchor text
    How would you implement this?
    Thanks

    • November 9, 2009 mcinvale

      What specifically would you like to populate the title attribute?

      • November 10, 2009 Rasmus

        Maybe just the anchor text at first – so it appears in the title attribute also

  13. November 18, 2009 Andy H

    Grate plugin thanks!

    One tiny but crucial flaw. When viewing single image from attachment template the next and previous Page links point to that same attachment page. When clicked, nothing happens.

    Would be so great if you could fix that :)

    Really nice work, thanks a lot!! :)

    • November 18, 2009 mcinvale

      The plugin isn’t designed to work with images, sorry.

      • November 20, 2009 Andy H

        I’m try to be more clear.

        I have five pages that have 10 attachments attached to each. When I’m viewing a page and click an image thumbnail open so that it opens as an attachment page I cant anymore change the page.

        I mean I’m still changing from page to page, not from attachment to attachment. I use something like next_image_link() to flip through the attachments.

        Hope I explained myself clear enough :)

        • November 20, 2009 mcinvale

          I understand what you’re saying, the plugin isn’t setup to do that.

  14. January 14, 2010 Jules Siegel

    I’d like to change the color of the text. Where do I do that?

    • January 14, 2010 mcinvale

      You’ll want to use CSS for that.

      • January 17, 2010 Jules Siegel

        Thank you. Yes, I am aware of that. Where is the CSS for the plugin?

        • January 18, 2010 mcinvale

          there is no CSS bundled with the plugin, just add it to your theme’s styles.

          • January 18, 2010 Jules Siegel

            I will be extremely grateful if you can help me out with a line or two of code to do that

  15. January 18, 2010 pkstaff

    Hello there… I’m working with the theme IMPREZZ, and so far have not had any trouble editing it. However, when I try to add this plug-in or even others so that I can view previous/next pages, nothing shows up once the code is updated, even if I manually add in the code instead of just installing the plug-in. Is this a problem with the plug-in or is something not communicating right with the theme?

    • January 18, 2010 mcinvale

      You need to include the functions in you theme’s files for this to work.

      • January 19, 2010 pkstaff

        Turned out it was an error made by the developer, but he released an updated version of it. Thanks anyway!

      • July 28, 2010 Cindy

        Can you tell me which files to put the code in? I’m using Thesis 1.7. Thanks so much!!!!!!

        • July 28, 2010 Cindy

          I put it in my custom_functions.php file, but it doesn’t show up. Please help. What am I doing wrong? Thanks!

          • July 28, 2010 Matt McInvale

            Cindy, you just install the plugin and then modify your theme files.

          • July 28, 2010 Cindy

            Does anyone know Thesis? I guess I’m supposed to put the code for this plugin in my theme’s page.php file, but Thesis doesn’t have that file. It uses hooks in the custom_functions.php file. Any ideas?

            Thanks!

          • July 28, 2010 Cindy

            Okay, I got it this far. Here is the hook I used in Thesis:

            function page_ads() {
            if (is_page()) { ?>
            |

            <?php }
            }

            Yay. Now, how do I make it so it just does all the child pages and skips over the parent pages? I have the parent page menu linked to #, so it doesn't go anywhere. That's why I need to skip over the parent pages.

          • July 28, 2010 Cindy

            Sorry, the code didn’t post correctly in my last post.

  16. January 18, 2010 jasotasticon

    EXCELLENT PLUGIN!!!! I LOVE YOU!!!!

    This is just what I needed.

    Now I am wondering, is there a way to keep looping on, but restrict it from climbing back up in hierarchy, i.e. to get it to go from A in the list below through A1, A2, A3 then to B1, B2, B3 without hitting B?

    A
    1.
    2.
    3.

    B
    1.
    2.
    3.

    • January 18, 2010 mcinvale

      You would need to modify the plugin to do that.

    • July 28, 2010 Cindy

      This is what I want to do, also. How exactly would we modify the plugin to do that?

      Thanks for your help!

  17. January 23, 2010 Richar

    Great plugin, it’s exactly doing what I want.

    However, when the plugin is used on a page without child pages it will display links to other pages.
    Is there a way to dsplay nothing if there are no childpages?
    Thanks!

    • January 26, 2010 mcinvale

      I’d have to see your page hierarchy to understand what you’re trying to accomplish.

      • January 28, 2010 Richard

        What I mean: I have several pages. One of the contains child pages.
        When I activate the plugin, and view a chid page verything is OK. When I view a page which isn’t a child page and don’t have child pages it will display a link to the next page.

        I kind of solved it right now, to put a IF statement in my template design; if the parent of the current is ID x then show next/prev links.

        I have temporarily disabled that IF statement, so you can see on my site what I mean.
        All the links on the menu on the top of the site are pages (except the first 2 from the left). Only the link/page called ‘attracties’ has child pages.
        You can also see that the ‘about’ page is linking to the first child of the ‘attracties’ page.

        • February 5, 2010 mcinvale

          if you can email me a link to your site i’ll take a look at it.

  18. February 17, 2010 Karyn

    I can’t figure out how to get this to work (my fault…major novice here). I installed this plug in, and typed in the above code, but I must be doing something wrong. Could you please tell me exactly the code I should use so that I have “next” “previous” navigation on all the child pages under the FAQs pages of the site? I assume the code should go on each “child” page, and what, if any, specific to my site code would need to be included? Thanks!

    • February 18, 2010 mcinvale

      Did you get this working? I see the next/previous links on the site you linked to.

  19. February 24, 2010 David Long

    Love the plug-in, but I just can’t figure out how to align the text.
    I want’Previous’ to be on the left of the page, and ‘Next’ to be on the right.
    Any tips?

    • February 24, 2010 mcinvale

      Wrap the output in a container that floats left and/or right depending on your needs.

  20. March 18, 2010 Offminded

    Hey great plugin,
    I’ve been trying to come up with a solution which you did already with this plugin. Thanks.

    My only problem is, I’m using “expand” argument to navigate parent sibling pages, but when I’m on a subpage, it shows it own parent link as next link, not next parent.

    I’ll try to explain below:
    Parent A
    – Sub A1
    – Sub A2
    – Sub A3
    Parent B
    – Sub B1
    – Sub B2
    – Sub B3

    When I’m on the Sub A3 page, the “next link” is supposed to show Parent B, right? But in my situation “next link” shows Parent A. I need “Parent B” to show as next link when I’m on Sub A3 page.

    I’m using
    $nextPage = next_page_not_post(”, ‘expand’, ‘sort_column=menu_order&sort_order=desc’);
    $prevPage = previous_page_not_post(”, ‘expand’, ‘sort_column=menu_order&sort_order=desc’);

    as function arguments. Also each page have order numbers.

    Any ideas would be greatly appreciated. Thanks.

    • March 18, 2010 mcinvale

      Are you using the same sort_order in your navigation? It looks like your pages are ascending but you’re using descending in the arguments.

  21. April 2, 2010 justin

    I only want to navigate between the parent pages. Is there any way to modify this plugin so that it will exclude child pages?

  22. April 2, 2010 justin

    Never mind I figured it out. If you want the code it’s here:
    http://pastie.org/901280

    Just modify the “get_pages” function in the plug-in PHP file so that it only grabs parent pages.

  23. April 5, 2010 Craig Dennis

    Great plugin. I was playing about with it and have added additional functionality for $before and $after to allow text to be included in the tag just like the native WordPress version.

    I have put it in Pastebin located here.

    Now you can call next_page_not_post($before,$after) and the whole thing is a link.

    I haven’t done extensive testing but it works for me

  24. April 5, 2010 Craig Dennis

    Just fixed a problem with $before and $after still showing when there is no title displayed (ie it has reached the end of the child pages).

    Update: Please use this version

    • April 5, 2010 mcinvale

      Thanks Craig, I’ll take a look at this and possibly merge into the plugin.

    • August 3, 2010 Richard

      Hey great, that works for me perfectly! Just what I was looking for! Thanks!

      I’m on WP 3.0.1 btw.

      • August 3, 2010 Richard

        Woops! The before and after text weren’t appearing properly for the next_page_not_post as they were for the previous_page.. but after simply copying the code from the insde of previous_page to _next_page, it works fine now..

        Sorry, I don’t know how better to explain.. :(

        • August 3, 2010 Richard

          Ok, I lied previously. It DIDN’T work, but I have fixed the plguin so that it now does work as it should. The problem was that the $before text was not showing up for some reason with next_page_not_post. I have put an updated version here: http://pastebin.com/E94Ekgui

          I highlighted the little changes I made.

  25. April 6, 2010 justin

    I got the “next_page_not_post();” link working but not the “previous_page_not_post();”. Is there any way to make it so that the links only show the parent link even if you are on a child page? So for instance: If my site looks like this:
    1
    2 -A -B -C
    3
    (Numbers are parents, letters are children)
    If a user is on the -B child page then the navigation would be “3″ and “1″ (or vice-versa).

    Using this code: http://pastie.org/901280 I was able to make the “next_page_not_post();” link do this, but the “previous_page_not_post();” show the wrong link.

  26. April 20, 2010 John

    Awesome plugin. It does something that WordPress should do ‘out of the box’. Thanks!!!!!!!!!!

    :)

  27. April 22, 2010 Jrack

    Thanks for this great plugin. It’s working well, however it seems to skip sibling pages which have too high of an order assigned to them. As far as I know, page order assignments don’t need to be sequential (ie- you can have pages set to 1, 2, 5, 10, etc).

    I’m using the code which Offminded posted:

    $nextPage = next_page_not_post(”, ‘expand’, ’sort_column=menu_order&sort_order=desc’);
    $prevPage = previous_page_not_post(”, ‘expand’, ’sort_column=menu_order&sort_order=desc’);

    Any ideas?

    Thanks,

    Jrack

    • April 22, 2010 mcinvale

      can you email me a link to this in action? it shouldn’t be doing that.

  28. April 23, 2010 Caitlin

    Ok, I’m starting to feel really dumb here, but I can’t seem to get it to work properly.
    The first code example displays nothing at all for me, and using the second code example (and variations thereof), the Next Page and Previous Page links just link to the page you are currently on.
    I’m obviously doing something wrong, but I can’t figure out what it is. :/

    I’m using:
    $nextPage = next_page_not_post(‘Next Page’, ‘true’, ‘sort_column=menu_order’);
    $prevPage = previous_page_not_post(‘Previous Page’, ‘true’, ‘sort_column=menu_order’);

    Example: http://www.varlabs.ca/shop/t-shirts/my-little-betta
    The previous/next pages should be the different product pages, but it just links to the same page. The same effect happens on the parent pages as well.

    • April 23, 2010 mcinvale

      What are you using for your shopping cart? Is each product assigned as it’s own page in WordPress?

      Nice betta shirt. :)

    • April 23, 2010 Caitlin

      Thanks for all your help, Matt!

      To anyone with a similar problem: turns out that the plugin “Exclude Pages from Navigation” doesn’t play nicely with Next Page, Not Next Post. I’ll post an update if anything changes.

  29. April 27, 2010 Weyakin

    Thanks for the plug in! It *almost* does what I need it to, but not quite. I’m doing next and previous pages within sub-pages, which have parent categories. Currently, it only stays within the one parent. I’m hoping to have it skip over to the sub-pages in the next parent, rather than looping within one parent. I ordered all of the pages involved in the WP back end, but it doesn’t make a difference. Any thoughts? Thank you so much!

    • April 27, 2010 mcinvale

      can you post an example hierarchy or a link to the site you’re working on?

      • April 27, 2010 Weyakin

        This is one of the completed pages:
        http://www.oldfarmslandscaping.com/masonry/terraces-walls/

        “Terraces & Walls” is a sub-page of the page “Masonry”. The next/previous buttons will move among pages under Masonry, but will not continue over to the other categories. For example, if you are on the “Columns” page, I would like it to jump over to the “Water Features” page under the “Unique Elements” category next. Instead, it loops back to the “Walkways & Patios” page under “Masonry”. The client is hoping to walk their viewers through each service they provide using the next buttons, under all of the categories listed in the above drop-downs.

        Hope that made sense! Thank you so much for your help.

        • April 27, 2010 mcinvale

          set the 2nd parameter in the plugin to “expand” and the plugin will link the last child to the next parent page.

          take a look at the san diego wedding photographer site we did for an example of how this will work.

  30. May 6, 2010 Ryan Haywood

    Hello, thanks for the great plug-in! It is working perfectly just as I need it, except the the order in which the pages are sorted are not congruent with the actual order of my sidebar. I am using the pages widget, and my pages are sorted by Page order, which I control through numbering each post. What function do I use so that this plug in follows page order? I am sure this is a very simple fix, and I appreciate any help in advance.

    Again thanks for the great work!

    Ryan

    • May 6, 2010 Ryan Haywood

      Oh well that was easy, menu order works well for this. I had a syntax error regarding a different type of quotes.

      Thanks again!

      Ryan

  31. May 13, 2010 Euan Gallacher

    Hello! This plugin seems to be almost perfect. Is there any way to modify the code so that it only appears on child pages, not parents. Any help you can give would be great.

    thanks,
    Euan

    • May 13, 2010 Euan Gallacher

      Aha! Nevermind I found some help on wordpress dot com to let me add in subpage detection to the functions php.

      Thanks again for this great plugin!

  32. May 23, 2010 Aaron

    Love the plug-in as well. how would I style this though… let me give an example.
    I want an arrow left to be the previous and an arrow right to be the next. these two arrows are images. where do i incorporate this into my code to have the image be the ?

    thank!
    heres a link: http://belovedadvertising.com/mario/successful/urban-sunshine/

    • May 26, 2010 Matt McInvale

      Aaron, you should be able to use an image tag with the plugin. I haven’t tested that though. Alternatively, look up CSS techniques for replacing text with an image, there are many tutorials for that online.

      Your site looks good.

  33. June 23, 2010 Sumon

    This is very useful plugin but I am not success on my site. please, give me solution where I put the code. Tell me page name.

  34. August 2, 2010 Michael Bailey

    Brilliant! Worked straight out of the box :)

    Thanks,

    Michael.

  35. August 2, 2010 Ryan Haywood

    Anyway to exclude a page ID? This plug in is a life saver btw!

    • August 2, 2010 Matt McInvale

      everything in the final option is passed into the plugin, so you should be able to do something like “exclude=1,2,3,4″

      • August 2, 2010 Ryan Haywood

        Quick reply! What do you mean by “in the final option”?

        • August 2, 2010 Matt McInvale

          Like so:
          next_page_not_post(‘Next Page’, ‘true’, ‘sort_column=post_date&sort_order=desc&exclude=1,2,3,4′);

          • August 2, 2010 Ryan Haywood

            Thanks so much for the help! I am having trouble translating the code to mine

            next_page_not_post(‘Next’, ‘true’,
            ‘sort_column=menu_order’);

            I tried different ways of inputing exclude to no avail. Any more hand holding is much appreciated :) )

          • August 2, 2010 Matt McInvale

            next_page_not_post(‘Next’, ‘true’, ‘sort_column=menu_order&exclude=1,2,3′);

            Replace 1,2,3 with a comma delimited list of page IDs you want to exclude.

  36. September 14, 2010 martine syms

    Hello, thanks for making this plugin! It is almost working perfectly for me… I’m working on a portfolio site with both parent pages and child pages. I do not want the plugin to ‘expand’ and that option is not turned on, however it is still expanding from parent to child in ways that I don’t want. It works properly on the child pages, but not on all of the parent pages. It works on this page: http://scottwolniak.com/sculpture/, but not on any other page, like this one: http://scottwolniak.com/painting-and-drawing/. I’m pulling my hair out… please help. Thanks again!

    • September 15, 2010 Matt McInvale

      can you post the code you’re using in your template file?

      • September 15, 2010 martine syms

        I have the following in my page.php file:

        |

      • September 15, 2010 martine syms

        whoops sorry…
        |

        • September 15, 2010 martine syms

          apparently, i’m a bit dense. i don’t know how to get the code to show up. i’m taking out the ” one last try:

          ?php echo previous_page_not_post(); ? | ?php echo next_page_not_post(); ?

          • September 16, 2010 Matt McInvale

            That should work… do you mind sending me a login to your site? I can try to debug it there.

  37. September 17, 2010 woody

    Unfortunately, it’s not working on my site. I want to connect pages (/blog/001, /blog/002, and blog/003) with previous/next links, but currently prev/next links point to the page I’m on (e.g. when I’m on /blog/002, both prev and next links point to blog/002).

    Notes:
    1. I’m using the same code as your 2nd sample (01.-19. one) shown above.
    2. I’m using “pages” for my blog entries (as “posts” are used for photography part).
    2. I use “Custom Permalinks” plugin which enables me to name a URL freely.

    Hope these info helps. Thank you for your support. :)

    • September 20, 2010 Matt McInvale

      that should be working… can you send me a login to your site to review it?

  38. Pingback מדריך וורדפרס: פוסטים או עמודים? מה ההבדל ביניהם | felix007.com

  39. November 13, 2010 Bonnie Wiley

    I placed the following code into 1l1r-sidebar.php:

    1. I would like the little back and forward arrows along with the title (just my title is appearing–not Previous and Next).
    2. I would like to include the child pages.
    3. I used the Exclude Pages feature for pages I didn’t want, such as non-discrimination and privacy policies. I hope I did that correctly.
    4. What if I just want to use this plug-in for one parent (SOAR/POS Tutorial) and its children? How would I do that?

    I am a beginner, so I will need step-by-step directions and code examples, please! I don’t understand php and the jargon.

    Thank you to anyone who can help me!

  40. November 13, 2010 Bonnie Wiley

    Sorry, is there a secret to entering code here? It didn’t show up. Removing ” and ‘?

    Let’s try again.

  41. November 13, 2010 Bonnie Wiley

    So, how do I place code here? Help!

  42. November 24, 2010 diego

    Another one here who doesn´t know how to get both the arrows and the page title on the link, still can´t figure out the code for both displaying together, as i am seeing it in so many blogs.
    I sent you an email but now i think other beginners like me may benefit of this typical and probably silly question.
    Nice plugin anyway, i am quite new on this too and i am just learning as much as i can, but this one was already so necesary for wp.
    Thank you!!

    • January 6, 2011 Bonnie

      I tried earlier to get code to show up in a post, and it didn’t work. So I hope this does. Here is what we did to get the arrows. We added &rarr for the right arrow and &larr for the left (see below). These are not the double arrows, which I would prefer, but they work.

      // determine if we have a link and assign some anchor text
      if ($output) {
      if ($anchor == '') {
      $output .= $anchorName . ' &rarr;';
      } else {
      $output .= $anchor;
      }
      $output .= '</a>';
      }

      return $output;
      }

      // determine if we have a link and assign some anchor text
      if ($output) {
      if ($anchor == '') {
      $output .= '&larr; ' . $anchorName;
      } else {
      $output .= $anchor;
      }
      $output .= '</a>';
      }

      return $output;
      }
      ?>

  43. December 30, 2010 Melvin Rivera

    To fix the loop issue, change:
    isset($loop)
    to:
    isset($loop) && $loop == true

    • December 30, 2010 Matt McInvale

      That shouldn’t be necessary but if it works for you, stick with it. :)

  44. January 5, 2011 Bodhipaksa

    Great plugin, thanks! I’m just blown away that this is available, since some visitors to my site seem to have problems recognizing or using a menu!

    I’d put in a vote for a “before” and “after” parameter, so that I could have something like “Next: Page Title »”

  45. January 6, 2011 Bodhipaksa

    I need a little help. I have the next_page_not_post parameters set to ‘Next page »’,'expand’,” at present. The “next page” link seems to take me randomly through the menu, so that sometimes I’m jumping forward one page, and other times I’m jumping backward a few pages.

    If I have a menu like this:

    parent1
    -child1
    -child2
    -child3
    parent2
    -child1
    -child2
    -child3

    what parameters do I need to set to work through these pages from top to bottom?

  46. January 6, 2011 Bodhipaksa

    Ah, OK! sort_column=menu_order&sort_order=desc seems to have taken care of it.

  47. January 6, 2011 Wille

    I have the plug-in installed and i placed the provided code (above) in my page.php file. The links are working, but they loop through. Example: Page A has sub pages 1, 2, 3. page 1 links forward to 2 AND backward to 3, page 3 links forward to 1 and backward to 2, etc. it’s a never ending click-through. How can i break the circle so no previous link appears on page 1 and no next link on page 3?

    • January 7, 2011 Matt McInvale

      Set the 2nd paramter to false.

      next_page_not_next_post(‘Anchor’, false, ‘query’);

  48. January 7, 2011 Wille

    Thank you for the reply. It is currently set to false, I have also left it blank with no success. The links appear and work great (thank you greatly for the plugin) but I cannot get the endless loop to stop. This is what I have:

    $nextPage = next_page_not_post(‘Next »’, false, ‘sort_column=menu_order&sort_order=desc’);

    $prevPage = previous_page_not_post(‘« Previous’, false, ‘sort_column=menu_order&sort_order=desc’);

    adn teh links still continuously loop. page one should only have a next link and page 3 should only have a previous link.

    • January 8, 2011 Wille

      Ok so i found a work-around, thanks for the offer to help tho.

      I think there may be a bug in the plug-in. I uninstalled and reinstalled the plug-in and placed the minimum code in my page.php file:

      This resolved the looping of next/previous link. BUT whenever i set any parameters, the looping happened again, previous link on pg 1, next on pg 3.

      To resolve, i edited the plug-in php file, setting the anchor text here, replacing the default of page title.

      Not sure if this is a bug or what, but may be worth looking into.

      Thanks so much for the plug-in as well as responsive answers to help. I was able to add if statements to my page.php file as well to limit the links to specific pages as well as add a ‘||’ separator when both previous and next links appear.

      Thank you!

  49. January 14, 2011 Lee Winter

    This plugin looks good, but I am looking for specific features and I cannot tell if they are present from the description provided. The key feature is the automatic generation of anchor text. I would like the anchor text to support a format string like “← %slug%”, which would substitute the sibling/targert page’s slug into the format and then use it as the anchor.

    Another feature I am seeking is the automatic generation of link titles. I would like the title to be either a format string that supported a %title% variable or to default to the title of the sibling/target page.

    PLease let me know whether this is possible.

    • January 15, 2011 Matt McInvale

      Not part of the plugin currently, I will be adding that functionality though. We’ve been very busy with client work recently, so this type of thing is on the backburner.

  50. January 19, 2011 parampara

    hi there, it’s a really great great plugin. I put it in a loop to the page.php code which looks like this:

    What do I need to type in and where to hide the next/prev links from parent pages, and to make the links only go between child pages, ignoring the parents? Please take a look here: http://www.parampara.pl/imp/zbiory-parampara/reszta-swiata/
    it’s a main page (parent) for ‘the rest of the world’ items, from which you can go to each item’s own page (child). The link at the bottom directs to the last item (child) from india (another parent). I would like it to be gone completely or to direct to india main page, i.e. to previous parent page instead of its child. I hope it’s clear enough ;)

    thanks for help
    kat

  51. January 19, 2011 parampara

    the code went missing, sorry

  52. January 28, 2011 Drew

    Greta plugin, well done.

    A suggestion would be to respect menu order (as mentioned above) and to allow for having no text in the link (so we can use a next arrow graphic for example). This can already be done by putting a space as the parameter, but its a little hacky.

    Otherwise this is great!

    • January 31, 2011 Matt McInvale

      Use the third option to control the get_pages parameters, set that to whatever sorting you’re using.

  53. January 31, 2011 parampara

    hi there,
    is there any chance you could tell me, how can I make this plugin (which is really great overall) respect menu order in a way that if you are on parent page it doesn’t link to next/previous parent’s children, and instead it would link to next/previous parent thus ignoring children? If you’re on child page, can you somehow ignore parents?

    • January 31, 2011 Matt McInvale

      What do you have looping set as?

      • January 31, 2011 parampara

        hi
        I’m not sure I understand what you mean. The code is in no loop. It’s just on page template, after a post section, and is quite basic without any amendments:
        d i v clas= ” navigation ”
        d i v clas= ” alignleft ” php echo previous_page_not_post (); / div
        d i v class= ” alignright” php echo next_page_not_post (); / div
        d i v style=” clear :both /div

        • January 31, 2011 Matt McInvale

          That is likely the problem.

          How are your pages sorted? Pass the same parameters to the function as the third parameter.

          • January 31, 2011 parampara

            Thanks – but sorry I really don’t understand, what do you mean exactly?

          • February 1, 2011 Matt McInvale

            The plugin accepts 3 parameters. Use the third to control how pages are sorted.

          • February 1, 2011 parampara

            thanks, I will do it. Could you please help me out how? I just add “$loop” between the brackets?

          • February 2, 2011 Matt McInvale

            I’m sorry, I can’t provide that much support for a free plugin. You should probably try to hire a developer to help you out.

  54. February 6, 2011 qboy

    I want to have the next/previous like this. If B is active it should show TEAM and another site on the parent level. Do you have any idea for this. Thanks!

  55. February 7, 2011 qboy

    I don’t see it in the docu. Must I change get_pages?

  56. February 8, 2011 qboy

    It does’nt exclude child_pages for my site.

  57. February 9, 2011 Paul Warren

    I am using something like:
    <?php query_posts('post_type=page&posts_per_page=3&post_parent='.$parent);

    Which displays 3 posts on a sort of archive page. I know this would usually be done with posts but is it possible for this plugin to display the next/prev 3 page excerpts rather than jump to the the next/prev sibbling page?

  58. February 9, 2011 qboy

    i used the way of justin, but it is not resolved at all.

    $getPages = get_pages(array(‘parent’ => 0,’sort_column’ => ‘menu_order, post_title’));

  59. February 12, 2011 Wayne

    If you want to turn off looping set the second parameter to NULL.

    This will work (looping is off)

    next_page_not_post(‘back’, NULL, ‘sort_column=menu_order&sort_order=desc’);

    Setting it to ‘false’ or false will not work.

    These DO NOT WORK (looping stays)

    next_page_not_post(‘back’, ‘false’, ‘sort_column=menu_order&sort_order=desc’);

    next_page_not_post(‘back’, false, ‘sort_column=menu_order&sort_order=desc’);

    • October 14, 2011 kdot

      You’re the looping fix hero for posting this Wayne!

  60. February 15, 2011 Elaine Hilides

    Please forgive my ignorance, I am very new to plug ins. I inserted the short code [next_page] into my page and was directed to the next parent page rather than to the child page. I have attempted to make sense of the codes and comments above but failed miserably:(

    • February 15, 2011 Matt McInvale

      that should roll back to all defaults. can you send me a link to the page you’re testing on? i’ll take a look at it.

  61. April 10, 2011 stefan

    Really nice Plugin for this missing feature!
    Maybe you could add rel attributes “next”, “prev” and “up” for the sake of accesibility ;)

    • April 11, 2011 Matt McInvale

      good suggestion, thanks. i’ll see what i can do about including that in the next version.

    • April 16, 2011 Harry

      Yep, what Stefan said. It would solve a lot of people’s problems. Then again, thank you for getting it this far.

      I can’t believe this is not in WP core, while it is advertised as CMS, while post categories starting with %category mess things up, so you will have to use pages.
      /rant :)

  62. April 17, 2011 Drew Baker

    Hey Matt,
    Quick question, is there a way to get this to allow you to loop through siblings and cousins, but not parent pages?

    For example:

    - A
    - – a1
    - – a2
    - B
    - – b1
    - – b2

    I want to get a1, a2, b1, b2 but not A or B.

    Is that possible?

    Thanks for the help!

    -Drew

    • April 18, 2011 Matt McInvale

      You want it to jump from a2 to b1?

      • April 18, 2011 Drew Baker

        Hey Matt,
        Yeah, I want to go from a2 to b1, skipping B.

        The idea is to go through all grand children, not parents.

        Thanks for the help!

        • April 19, 2011 Matt McInvale

          You’d need to add some conditional logic to your theme’s template files. Just have it check the current depth before using the plugin’s functions.

          • April 19, 2011 Drew Baker

            Hey Matt,
            Thanks, that is a good idea. But I’m not sure what the logic in that test would be?

            if( on last child page) {
            Jump to first child of next parent
            } else {
            Go to next sibling
            }

            And then do similar for previous pages.

            I don’t think WordPress has conditional logic to do that sort of thing, that’s why I was hoping this plugin would be able to do it.

            Thanks again!

          • April 25, 2011 Matt McInvale

            You’re actually correct, it isn’t as simple as I had made it sound. You would need to modify the functions within my plugin to do something like this. Perhaps adding a new check for number of ancestors and continue looping through data if those don’t match.

          • May 10, 2011 Drew Baker

            Hey Matt,
            SO I’ve been trying to figure this out. I have a post on stack overflow here:
            http://wordpress.stackexchange.com/questions/16875/get-next-previous-cousin-page

            I’ve been toying with adding a new “elseif ($loop == ‘cousins’)” statement to your plugin. But maybe it’s easier to just add an if inside the “$loop == ‘expand’” statement that says “if next is parent, then skip, and show the child”.

            Do you have any thoughts on that?

            Thanks again for the great plugin! It really seems like “next page” should be built into core.

    • July 16, 2011 Loren Swendsen

      Hi Drew did you ever arrive at a solution for this? I’m developing a site right now that needs the exact same functionality that you describe.

      Would love to hear what you finally did.

      • July 18, 2011 Matt McInvale

        I added this functionality to the plugin, just haven’t had a chance to update the repository yet. It’s on my to do list, but client work comes first.

  63. June 13, 2011 Mark

    Hi Matt,

    I’m completely clueless here – I just don’t understand the installation instructions.

    Thanks

    Mark

    • June 13, 2011 Matt McInvale

      What don’t you understand?

      • June 13, 2011 Mark

        I don’t know what the following means:

        You say it’s as simple as echo’ing the functions in your page:

        That’s double dutch to me, mate.

        Also, you say that shortcodes are for users that aren’t able to edit their theme files. It then goes on to say what the shortcodes are, but I can’t see how to actually apply them.

        • June 13, 2011 Matt McInvale

          You should probably go the shortcode route, they are:

          [next_page]
          [previous_page]

          • June 13, 2011 Mark

            How do I apply them ?

          • June 13, 2011 Mark

            I’ve finally figured out how to apply the shortcodes. It wasn’t obvious to me because I’m new to WordPress, & I’m not a technical person.

            In the Shortcodes section above it says:

            Each supports 3 attributes: anchor, loop and getPagesQuery

            How do you go about using these options ?

          • June 13, 2011 Matt McInvale

            You should read up on the WordPress Shortcode API here: http://codex.wordpress.org/Shortcode_API

            Your shortcode will look something like this:
            [next_page anchor="My Anchor" loop="true"]

  64. June 13, 2011 Mark

    I’ve got 2 sorted out:

    anchor=”x” where x is any text you want
    loop=”x” where x is either tue or false

    What is the correct format etc for the Get Pages attribute ?
    I’ve tried different possibilities, with no luck.

    I read through the page you linked, but I’m still struggling.

    • June 13, 2011 Matt McInvale

      That goes beyond the level of support I can provide for this plugin. You may want to ask in the WordPress.org forums.

      • June 13, 2011 Mark

        I presume the format would be something like this:

        attribute=”x”

        Can’t you tell me the name of the attribute & the options for x ?

  65. June 18, 2011 thomas b. rouge

    hey matt,
    great plugin works well for child and grandchild pages
    i am using the in my template.
    how is it possible to use an image for the link and not the name of the page?

    best regards

    • June 18, 2011 thomas b. rouge

      i just found this out for myself:
      echo next_page_not_post(”);
      cool!

      • June 18, 2011 thomas b. rouge

        echo next_page_not_post(‘[img src="http://www.ihreleitseite.de/wp-content/uploads/arrow.png"]‘);

  66. June 28, 2011 Zorem

    Not working with my hebrew site + (/%category%/%postname%/) in hebrew

  67. June 28, 2011 Zorem

    NVM! thanks for all, I got it

  68. July 1, 2011 rashad

    im having trouble with this plugin. can someone please help me? i have a lot of Top 10 List on my site and want my readers to navigate through the list instead of it just being one long page. Can you help me with this?

    • July 1, 2011 Matt McInvale

      Create a page for each top 10 list and then use the plugin to create next & previous navigation.

  69. July 1, 2011 rashad

    ok. but how. with which code?

  70. July 6, 2011 kmcgill

    what are these colorful patterns that each of you have as your icon images??

  71. July 22, 2011 tgp

    Is it possible to target just a parent of pages and its child?

    I use page.php for all pages, with this plugin, all pages show the links. Suppose “Team” page in your example above is a parent page, I want A, B, C, D, E, F and so on to have the previous and next links, but I don’t want the Team page and other Parent pages have the links.

    Thanks!

  72. October 2, 2011 Todd

    Don’t you think a simple example of how the three attributes are to be used with a shortcode would have been helpful?

    • October 2, 2011 Matt McInvale

      Nope, I think my documentation explains things pretty clearly. If you’re having trouble with something, let me know and I’ll see if I can help.

  73. October 19, 2011 Hannemaatje

    Hi, Thanks for this nice plugin.
    I seem to have some trouble with the $loop.
    It loops, although I’ve tried both ‘false’ and putting nothing in it at all… as it should default to not looping… any ideas?

    This is how I use it:


    <?php
    $nextPage = next_page_not_post('%title', 'sort_column=menu_order&sort_order=asc');
    $prevPage = previous_page_not_post('%title', 'sort_column=menu_order&sort_order=asc');

    $nextPageTagged = str_replace('" title=','#access" title=',$nextPage);
    $prevPageTagged = str_replace('" title=','#access" title=',$prevPage);

    if (!empty($nextPage) || !empty($prevPage)) {
    if (!empty($prevPage))
    echo '
    <<< Ga terug naar '.$prevPageTagged.'
    ';
    if (!empty($nextPage)) echo '
    Ga verder naar '.$nextPageTagged.' >>>
    ';
    }
    ?>

    • October 27, 2011 Matt McInvale

      Try this:

      next_page_not_post(‘%title’, NULL, ‘sort_column=menu_order&sort_order=asc’);

  74. October 28, 2011 Hannemaatje

    Yes, thank you! That works!

  75. November 26, 2011 Clemens

    Hi there,

    how can i exclude the function on certain pages? For example: i don’t want to display the links on the home page or the contact page. How can I manage this?

    By the way, i love the plugin. Didn’t expect something like this exists, it’s really helpful.

    • November 28, 2011 Matt McInvale

      Wrap the function with a conditional statement, something like this:

      // exclude from the frontpage
      if (!is_front_page()) {
      // include your next-page code here
      echo next_page_not_next_post();
      }

      Check the Conditional Tags page in the codex: http://codex.wordpress.org/Conditional_Tags

      • November 29, 2011 Clemens

        sorry, but i cant see any code ;) could you please explain it further?

        • November 29, 2011 Matt McInvale

          Edited my original comment to include sample code.

          • March 27, 2012 Clemens

            This works for me, but the » and « chars are not displayed anymore… why? do you have a solution?

          • March 27, 2012 Clemens

            I now solved the problem, thank you very much :)
            this is my code:

  76. November 27, 2011 Joey

    Hello –

    i’m pretty clueless in PHP so I’m using the short codes. Wondering if you could tell me how (if it is possible) to have the next/previous posts be based off of the order as defined by the menu order.

    Thanks.

    • November 27, 2011 Joey

      Also – I use a genisis theme and the menu order is based under the appearance as opposed to the “My page order” under pages. Not sure if that matters.

      • November 28, 2011 Matt McInvale

        The plugin follows menu_order by default. I don’t know enough about Genesis to tell you if that is interfering with the plugin.

  77. November 30, 2011 Ashley

    Is there any way to have the links just say “Previous” and “Next” instead of the next page title?

    • November 30, 2011 Matt McInvale

      The first argument with each function is the anchor text, use that. Something like this:

      next_page_not_next_post(‘Next Page’);
      previous_page_not_next_post(‘Previous Page’);

  78. December 1, 2011 rgipson

    Thanks for the great plug-in but I have a functionality request.

    My hierarchy is:
    Parent A
    – Child 1
    – Child 2
    – Child 3
    Parent B
    – Child 1
    – Child 2
    – Child 3

    I would like this to go from Child 3 > Parent B on “Next”. And the reverse, Parent B > Child 3 on “Back”.

    Is there a way to do this?

    • December 1, 2011 Matt McInvale

      Set the 2nd parameter of each function to ‘expand’.

      • December 1, 2011 rgipson

        Great that works well for going forward “Next” but it does not jump backwards over the Parent.
        Example:
        You can go from Parent A (Child 3) > Parent B (Child 1)
        BUT NOT
        Parent B (Child 1) > Parent A (Child 3)
        Any ideas?

  79. December 17, 2011 ELOY

    Thank you for your work, this is an indispensable plugin for wordpress!

  80. December 18, 2011 Ian Miles

    Excellent! Invaluable! Finally get those perky links to work! :p

  81. January 7, 2012 telemarker

    hi there i got it working with images.
    and i want to have a hover effect at the image to change its color


    ?php echo previous_page_not_post(''); ?>

    when i tried this there comes an error page.
    normally this works quite good with image links. how can i get it working with the plugin?

    best regards
    thomas

    • January 7, 2012 Matt McInvale

      I’m not really sure what you’re asking. if you’re getting an error, debug that. I deleted your other comments.

  82. January 7, 2012 telemarker

    i do not have skills to debug.
    you are the men who wrote this cool plugin and might have the knowlegde to solve my little problem.

    • January 7, 2012 Matt McInvale

      Please don’t post multiple comments, I’ll reply to your original message as time permits.

      What does the error say that you’re receiving? That is the first step in debugging this.

      • January 7, 2012 telemarker

        okay,

        i got:

        Parse error: syntax error, unexpected T_STRING in /homepages/44/d177360701/htdocs/janinearnold.net/wp-content/themes/agency/page-pics.php on line 27

        what i try to achieve is the following:
        i am using the plugin for switching sites.
        i am not using text links but images.
        left and right arrows.
        they should change colors when hovering over them. that’s all!

        • January 7, 2012 Matt McInvale

          As I previously stated, *please* do not post multiple comments.

          If you’d like me to debug your site for you, you’ll have to pay for the time. We currently bill at $125 an hour.

          You have a syntax error in your PHP.

          • January 8, 2012 telemarker

            are you kidding?

            of course i got a syntax error. that’s why i’m asking you! i use a code that is working on many sites i created. somehow i cannot figure out to send it to this forum and you are not even explaining how i can do this.
            if you are a plugin creator with honor and willing to give support here, it will cost you 1 minute to find out this little thing.

            for 125 usd i can hire somebody that writes me a new plugin. how about 20 bucks though?
            all my best

          • January 8, 2012 Matt McInvale

            Telling someone they don’t have honor is really bad way to ask for help. You should hire a developer to assist you with whatever you can’t figure out. Have a good Sunday.

  83. January 12, 2012 todd

    Hey this plugin works great! I am having one tiny problem that I’m trying to figure out, and I’m not the greatest with PHP. Right now I have about 5 parent pages and some of them have a couple child pages. If you are on a parent page (that has children of course) the plugin will cycle through the parent pages. If you are on a child, it will just cycle through the children of that parent.

    I’m trying to get it so that the plugin will cycle through the parent and just it’s own children. Is this in any way possible? I would really appreciate your help on this one. Right now I have the Previous/Next links hidden on the parent pages.

    • January 12, 2012 Matt McInvale

      Todd, can you show me an example of page hierarchy? I think I understand what you’re trying to accomplish, but it’s not perfectly clear.

      Thanks.

      • January 12, 2012 todd

        I can give you a link to the site I’m working on, but wish to not post it here since it isn’t complete. Can you email me (toddmette[AT]gmail[dot]com) and then I can send you the link with further details?

  84. February 8, 2012 Elena

    Hello!
    great plugin but how can I add &raquo and &laquo before and after page title.
    Thanks everyone.

    • February 9, 2012 Matt McInvale

      %title gets replaced with your page’s title, so you can do something like this:

      next_page_not_post(‘%title »’);

  85. February 11, 2012 Frank Stratmann

    I would like to build a manual and I use parent pages with several child instances.

    Now I would like to offer the next page link to the first child of a parent, and so on to the instances.

    The parents are menu Items on my page. And to have the look an feel of a manual. I would like to create a loop within one parent page infrastructure.

    I use the shortcode variant because I wouldn´t like to integrate the function on all pages. Only for my manual.

    This ist a possible structure:

    P1
    - C1
    - C2
    - – C2-1
    - – C2-2
    -C3
    -C4
    - – C4-1
    - – C4-2

    … and loop back to Parent.

    So I realize closed chapters for my readers. Offering them over menu Items by parent pages.

    Is this possible? And when, please forgive someone who is not very firm in php. I need a little more help.

    Thanks.

    • February 12, 2012 Matt McInvale

      From what I understand, that shouldn’t be a problem. You’ll want to hook into the “the_content” filter and use that to control the output of your functions.

      • February 12, 2012 Frank Stratmann

        This is the original code:

        function next_page_not_post($anchor='',$loop=NULL, $getPagesQuery='sort_column=menu_order&sort_order=asc')

        What Do I have to change. I tried something with parent and child_of but it seems to be not working

        http://codex.wordpress.org/Function_Reference/get_pages

        • February 13, 2012 Matt McInvale

          The markup will depend on what level of page you’re currently in. You’ll have to adjust the options based upon what you want to output.

  86. February 12, 2012 AI

    just tried your plugin,it’s awesome

  87. Pingback Wordpress plugins used | WTJR online Bible KJV

  88. March 14, 2012 Ed

    I’d like mine to work so that it stays inside the current parent. My pages are set like this…

    A
    -1
    -2
    -3
    B
    -1
    -2
    -3

    If I am on A there is no prev link. If I am on A3 then there is not next link. It keeps me inside the current partent and child.

    Possible without modification?

    Thanks!

    • March 15, 2012 Richard

      Hi,

      I modified the plugin a while back, because the before and after text wasn’t working for me. My version (based on .1.7, not the most recent version) stays within the parent, at least, it does on my site! No guarantees that this’ll work for you, but it works for me. Here’s the code:

      http://pastebin.com/QWQDLqWA

    • March 15, 2012 Matt McInvale

      Hi Ed, short of forking the plugin, I would use a conditional inside of my template to accomplish this.

  89. March 24, 2012 Steven

    Thanks for the plugin. It worked great; just what I needed.

  90. April 3, 2012 David Nussbaum

    Am I missing something? I cannot for the life of me figure out where to post the following, or if the following is even correct:

    functions.php? page.php? template.php?

    Thanks

    • April 3, 2012 Matt McInvale

      I can’t see your code, but you most likely need to use page.php.

  91. April 3, 2012 David Nussbaum

    sorry I uninstalled it for the time being.

    okay so I am using dynamic templates in my theme so I installed this:

    <?php
    $nextPage = next_page_not_post('Next Page', 'true', 'sort_column=post_date&sort_order=desc');
    $prevPage = previous_page_not_post('Previous Page', 'true', 'sort_column=post_date&sort_order=desc');

    if (!empty($nextPage) || !empty($prevPage)) {
    echo '
    ‘;

    if (!empty($nextPage)) echo ‘
    ‘.$nextPage.’
    ‘;
    if (!empty($prevPage)) echo ‘
    ‘.$prevPage.’
    ‘;

    echo ‘
    ‘;
    }
    ?>

    in my template-dynamic.php because your shorter code didn’t seem to do anything.

    but look, its in the bottom right corner of the page:

    http://revamp.metropolitandetail.com/?page_id=818

    I would like it in the bottom of the page content. And I don’t see the arrows!

  92. April 3, 2012 David Nussbaum

    okay I got it to work but now I want the PREVIOUS to be on the left and the NEXT be on the right but I’m not sure how to do this

  93. April 4, 2012 David Nussbaum

    I am a newbie so I’m not sure how to do this. Can you point me in the right direction how to code this and where to put this?

    Also, how do I exclude certain pages? If you go here:

    http://revamp.metropolitandetail.com/

    I only want ALL the service pages to have this feature. so you should be able to scroll from DETAIL (and it’s child parents) all the way to BEYOND (down to the last child page called leather conditioner
    )
    and then I wish for it to stop. So in theory there would be a <> and similarly starting at SERVICE would only provide a NEXT >> link and no PREVIOUS <<

    thanks

  94. April 25, 2012 Philip

    Hi.

    I have the following:

    A
    A-1
    A-2
    A-3
    B
    B-1
    B-2

    I want to go this way: A->A1->A2->A3 STOP!

    How?

  95. April 28, 2012 René

    Hello,

    Can anyone tell me in which template i put the code???
    I use photocrati theme.

    Thanks
    René

  96. May 6, 2012 Dustin

    Great plugin! One quick question… I noticed a user commented a few years ago asking about using this plugin with the “Page Title’s” being printed instead of “Next Page” and “Previous Page”. I didn’t see a resolution to that here.

    Is this possible? Can you simply call the page title in the PHP?

    Anyway, just curious if this is possible. The plugin works great even without this function, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.