Plugin Directory

Changeset 116542


Ignore:
Timestamp:
05/08/2009 05:03:43 PM (17 years ago)
Author:
mcinvale
Message:
 
Location:
next-page-not-next-post/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • next-page-not-next-post/trunk/next_page_not_next_post.php

    r114896 r116542  
    44Plugin URI: http://binarym.com/2009/next-page-not-next-post/
    55Description: Create next/previous navigation for pages. Adds the functions next_page_not_post() & previous_page_not_post() which link sibling pages.
    6 Version: 0.1.2
     6Version: 0.1.3
    77Author: Matt McInvale - BinaryM
    88Author URI: http://binarym.com/
     
    1010This is a terribly inefficient way of doing this, but it works for now.
    1111This should only use a single query to pull all sibling pages and then only
    12 loop that once as well. Oh well, I'll update that as time permits.
     12loop that once as well. Oh well, I'll update that as time permits. Don't hate.
    1313*/
    1414
    15 function next_page_not_post($anchor='',$loop=NULL, $sort='menu_order') {
     15function next_page_not_post($anchor='',$loop=NULL, $getPages='sort_column=menu_order&sort_order=asc') {
    1616    global $post;
    1717   
    1818    // first, we'll query all pages with a similar parent
    19     $getPages = get_pages('child_of='.$post->post_parent.'&sort_column='.$sort);
     19    $getPages = get_pages('child_of='.$post->post_parent.'&'.$getPages);
    2020   
    2121    $pageCount = count($getPages);
     
    5252}
    5353
    54 function previous_page_not_post($anchor='',$loop=NULL, $sort='menu_order') {
     54function previous_page_not_post($anchor='',$loop=NULL, $getPages='sort_column=menu_order&sort_order=asc') {
    5555    global $post;
    5656   
    5757    // first, we'll query all pages with a similar parent
    58     $getPages = get_pages('child_of='.$post->post_parent.'&sort_column='.$sort);
     58    $getPages = get_pages('child_of='.$post->post_parent.'&'.$getPages);
    5959   
    6060    $pageCount = count($getPages);
  • next-page-not-next-post/trunk/readme.txt

    r114902 r116542  
    16161. **Anchor Text** - Either set the anchor text manually or use the page title. Defaults to page title, just leave blank for that.
    17171. **Looping** - Link the first element to the last and the last to the first, or not. Defaults to not looping, set to true for looping.
    18 1. **Sort** - Set this to the order that your pages should be displayed in. Defaults to menu_order.
     181. **Get Pages** - This is used to determine how to sort your results. Use the documentation at [Get Pages](http://codex.wordpress.org/Function_Reference/get_pages) to find all available options here. Defaults to menu_order ascending.
    1919
    20 
    21 [More documentation is available at our site.](http://binarym.com/2009/next-page-not-next-post/)
     20[More documentation for Next Page, Not Next Post on BinaryM.com](http://binarym.com/2009/next-page-not-next-post/)
    2221
    2322== Installation ==
     
    3029== Frequently Asked Questions ==
    3130
    32 None at this point. Contact me if you have any and I'll add them here.
     31None at this point. [Contact me](http://binarym.com/contact/) if you have any and I'll add them here.
Note: See TracChangeset for help on using the changeset viewer.