mlblanchard
Member
Posted 1 year ago #
Using the Hierarchical Pages Widget, checking the "Sort in menu order (else alphabetical)" box has no effect. The menu sorts alphabetically whether this box is checked or not. Any known issues that would cause this? Unfortunately I can't link to my site, because it's a client site in development they're not ready to expose to the public.
Thanks,
Michael
http://wordpress.org/extend/plugins/hierarchical-pages/
Did you get this working?
mlblanchard
Member
Posted 9 months ago #
Yes! I can't remember now what the exact issue was, but I think it was user error - my error, that is. :)
lalcala
Member
Posted 8 months ago #
I'm having the same issue. I checked to be sure that the box to sort in menu order is checked, but the pages keep showing up in alpha order. Can anyone help?
Thanks!
lalcala
Member
Posted 8 months ago #
By the way, I'm using WP 3.2.1 with the Genesis theme (child theme - Associate). Like Michael, I'm unable to provide the link to the client site at this point.
On about line 184 of hierpage.php you will see:
$this->hierpages_list_pages($page_options);
Immediately before this could you please insert the line:
print "<hr>"; print_r($page_options); print "<hr>";
and paste here what gets output between the horizontal rules?
lalcala
Member
Posted 8 months ago #
Thanks so much for your quick response. I'll try this and will report back. When you refer to output, do you mean what I see on the site after I've made this change?
lalcala
Member
Posted 8 months ago #
This is what I see in my sidebar after updating the php file.
show_siblings=yes&show_root=&show_home=&child_of=&sort_column=menu_order,post_title
OK, that shows the plugin is asking WordPress to list the pages by menu_order first and post_title second. Perhaps your theme is interfering somehow. Please contact me directly at bill@saltriversystems.com to see what else we can do to find the problem.
tamayo
Member
Posted 8 months ago #
A quick solution is to hardcode the sort order in the plugin file hierpage.php. Basically, the only option would be sorting by menu order. Around line 197, change
if ($instance['menu_order'] == 'yes') {
$page_options['sort_column']='menu_order,post_title';
} else {
$page_options['sort_column']='post_title';
}
to
if ($instance['menu_order'] == 'yes') {
$page_options['sort_column']='menu_order';
} else {
$page_options['sort_column']='menu_order';
}
I have not looked at the file carefully but it is possible the sort options on the widget are not being passed along. Also, if you upgrade the plugin, this change will be lost.
lalcala
Member
Posted 8 months ago #
Yaaayyyy, Tamayo! That worked. Fortunately I had the original plugin php that I was able to modify with your code. Thank you so much!
Bill, I appreciate your help with this, as well. I'm now running the older version of the plugin, but if another fix comes out, I'll upgrade.
In version 1.1 you should be able to set the sort column to just menu_order ... although, really, menu_order,post_title should sort first by the menu order and only use the title within groups of pages with the same value for menu_order.