Changeset 116542
- Timestamp:
- 05/08/2009 05:03:43 PM (17 years ago)
- Location:
- next-page-not-next-post/trunk
- Files:
-
- 2 edited
-
next_page_not_next_post.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
next-page-not-next-post/trunk/next_page_not_next_post.php
r114896 r116542 4 4 Plugin URI: http://binarym.com/2009/next-page-not-next-post/ 5 5 Description: 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. 26 Version: 0.1.3 7 7 Author: Matt McInvale - BinaryM 8 8 Author URI: http://binarym.com/ … … 10 10 This is a terribly inefficient way of doing this, but it works for now. 11 11 This 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. 12 loop that once as well. Oh well, I'll update that as time permits. Don't hate. 13 13 */ 14 14 15 function next_page_not_post($anchor='',$loop=NULL, $ sort='menu_order') {15 function next_page_not_post($anchor='',$loop=NULL, $getPages='sort_column=menu_order&sort_order=asc') { 16 16 global $post; 17 17 18 18 // 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); 20 20 21 21 $pageCount = count($getPages); … … 52 52 } 53 53 54 function previous_page_not_post($anchor='',$loop=NULL, $ sort='menu_order') {54 function previous_page_not_post($anchor='',$loop=NULL, $getPages='sort_column=menu_order&sort_order=asc') { 55 55 global $post; 56 56 57 57 // 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); 59 59 60 60 $pageCount = count($getPages); -
next-page-not-next-post/trunk/readme.txt
r114902 r116542 16 16 1. **Anchor Text** - Either set the anchor text manually or use the page title. Defaults to page title, just leave blank for that. 17 17 1. **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.18 1. **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. 19 19 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/) 22 21 23 22 == Installation == … … 30 29 == Frequently Asked Questions == 31 30 32 None at this point. Contact meif you have any and I'll add them here.31 None 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.