Support » Plugin: Hierarchical Pages Widget » [Plugin: Hierarchical Pages Widget] Sort not working

  • Resolved mlblanchard

    (@mlblanchard)


    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/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author wlindley

    (@wlindley)

    Did you get this working?

    Yes! I can’t remember now what the exact issue was, but I think it was user error – my error, that is. 🙂

    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!

    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.

    Plugin Author wlindley

    (@wlindley)

    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?

    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?

    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

    Plugin Author wlindley

    (@wlindley)

    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.

    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.

    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.

    Plugin Author wlindley

    (@wlindley)

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Hierarchical Pages Widget] Sort not working’ is closed to new replies.