subpage menu order
-
How do I set the subpage links in the order I want?
I’ve tried specifying the page order option but it doesn’t do anything.
Thanks, in advance.
-
Is your code something like this?
<?php wp_list_pages('childof=5&sort_column=menu_order&title_li='); ?>This is what I have on the sidebar.php
<div class="sb_pagemenu"><h2><?php echo $parent_name; ?> Subpages</h2><ul>
<?php wp_list_pages('title_li=&child_of='. $parent_id); ?>
</ul>
</div>Your code does not pass the parameter “sort_column”
what should I change it to?
<?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>it seems to be working now, Thanks a lot !!
I am having the same problem as jk0170, above: Subpages do not sort properly. Here is the code I have no doubt botched up in sidebar.php modifying the wp-list-pages function.
<?php
/* Uncomment this section if you need to have more page navigation than the top
navigation bar allows. You'll still be able to have a few of the default
pages appear at the top (the one's that the Blix theme excludes by default).
**
?>
<h2><em>Pages</em></h2>
<ul class="pages">
<?php
$excluded = my_excluded_pages();
wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id);
?>In addition I have updated widgets.php, again modifying the wp-list-pages function:
//////////////////////////////////////////////////////////// Standard Widgets
function widget_pages($args) {
extract($args);
$options = get_option('widget_pages');
$title = empty($options['title']) ? __('Pages') : $options['title'];
echo $before_widget . $before_title . $title . $after_title . "<ul>n";
wp_list_pages("title_li=&sort_column=menu_order");
echo "</ul>n" . $after_widget;Obviously, I have no idea what I’m doing. Will anyone please help!?
Thanks!
Obviously, I have no idea what I’m doing.
Obviously. π
Your tags around the code are not correct. Look at this bit of code:
<?php
$excluded = my_excluded_pages();
<strong>wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id);</strong>
?>The <?php and ?> tags are supposed to surround all PHP code. But they can *ONLY* surround PHP code, they can’t surround HTML code. So that strong tag you have there is horking things up.
It should be like this instead:
<?php $excluded = my_excluded_pages(); ?>
<strong>
<?php wp_list_pages('title_li=&sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
</strong>See the difference? The PHP bits are in the <? tags, the non PHP bits are not.
Wow, that reply was fast!
Sorry, Otto42. I’m new to this forum (any forum!). The purpose of the Strong tags was to emphasize a line of code to the reader of the post. They are not actually in the code.
Would you be kind enough to have another look? I’ve updated the “horked-up” post. π
Thanks!
Well, there isn’t anything else obviously wrong with it. So, no idea.
OK, thanks for looking.
The topic ‘subpage menu order’ is closed to new replies.