Page Order Not Working!!?
-
Hi guys
I’m trying to reorder the main menu items on my site http://www.godhn.com
As you can see by visiting the site, all the links are in alphabetical order. However, they all have the Page Order property set, so should appear in the order I want them to?
First of all, is my understanding of Page Order correct?
In my admin, the pages are defined as follows..
ID, Page, POrder
———————
5, About, 4
31, Projects, 20
20, Resources, 30
26, Blog Roll, 40
32, Contact, 50So they should appear in that order?
My theme uses a custom wp_list_pages function, the code for this is presented below. I’d like to know why my Pages aren’t ordered correctly, and what to change to make it work?
Thanks… Dan.
wp_list_pages2()…
function wp_list_pages2() { $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 'child_of' => 1, 'exclude' => '', 'title_li' =>'', 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order'); $r = array_merge($defaults, $r); $output = ''; $current_page = 0; // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); // Allow plugins to filter an array of excluded pages $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); // Query pages. $pages = get_pages($r); if ( !empty($pages) ) { for($i=0;$i<count($pages);$i++) { $output .=' <td> <a href="'.get_permalink($pages[$i]->ID).'">'.$pages[$i]->post_title.'</a> </td>'; } } $output = apply_filters('wp_list_pages', $output); echo $output; }
The topic ‘Page Order Not Working!!?’ is closed to new replies.