Update to 1.5.3 Menu Order

  • Anonymous

    #2020

    Syahir, Thanks for the update!!

    One small issue… my main menu is in an order that is different from the order I specify in my “Pages”. Each page is numbered in the order I want. However, it displays alphabetically when viewing live.

    If I enable the “Header Menu” in the menu options tab, the order is correct… probably because it is using my custom menu. (But then I don’t get my page menu subtitles).

    So, the problem is with the default pages menu across the top of my page. They are displaying in alphabetical order rather than by page number.

    The menu order use to display “Home, Index, Life, Malea, etc…”. You can see how it is different now.

    Any suggestions?

    Anonymous

    #18213

    NOTE:

    I’ve also noticed the child pages sub-menus, in the main menu, also display in alphabetical order rather than by page number.

    Anonymous

    #18214

    Got it. The problem lies within “functions.php”.

    Here was the original code from the problem area:

    <?php
    $args = array( 'echo' => 1,
    'sort_column' => 'menu_order page_title',
    'depth' => 5,
    'title_li' => '',
    'walker' => new Walker_PageDescription() );
    wp_list_pages(apply_filters( 'graphene_default_menu_args', $args) );
    ?>

    And here is what I changed it to:

    <?php
    $args = array( 'echo' => 1,
    'sort_column' => 'menu_order',
    'depth' => 5,
    'title_li' => '',
    'walker' => new Walker_PageDescription() );
    wp_list_pages(apply_filters( 'graphene_default_menu_args', $args) );
    ?>

    Notice the “sort_column” attribute. This needs to be changed from 'sort_column' => 'menu_order page_title', to 'sort_column' => 'menu_order',.

    Thanks!!

    Admin

    Syahir Hakim

    #18215

    Just to explain things a little better:

    'sort_column' => 'menu_order page_title',

    means to sort the pages according to menu order first, then alphabetically. The problem is that the syntax is not correct. It should be:

    'sort_column' => 'menu_order, page_title',

    Notice the comma after menu_order.

    Anonymous

    #18216

    Gotcha. Dangit… and I thought I had one figured out on my own!

    Thanks, my friend!

    yaisahagood

    #18217

    I just updated also and now I am having this same issue. I am new to word press and don’t understand either post regarding how to fix this. Can you please help!

    Anonymous

    #18218

    Sure. Go to admin panel -> Appearance -> Editor.

    Then, in the top right, make sure “Graphene” is selected.

    Over on the right is a list of files. Click on “Theme Functions (functions.php)”.

    If you are using Mozilla Firefox, press ctrl-F and a search box will open in the bottom of your browser.

    Search for “sort_column” (without the quotes).

    Now, just add the comma in the code as pictured above. Your final result should look like this:

    'sort_column' => 'menu_order, page_title',

    Please let me know if you run into trouble along the way.

    yaisahagood

    #18219

    Thank you Josh. This worked! I have been working on my blog for over a month and it seems like everything that could go wrong has. Thank you again for your help.

    Anonymous

    #18220

    My pleasure.

    Is there anything else in particular you are struggling with? Perhaps I can help.

    HeleneS

    #18221

    Dear all, Any advice please NB I don’t know anything about codes!? I think Graphene will provide a simple, elegant template that will work for our website, so thanks! However, I also think I have the problem that the bar with all my pages on it is alphabetical and not in the original page order. I cannot show it to you because the site is still in a draft form. I have tried to follow your instructions above, but after I get to the bit about clicking on Theme Functions (functions.php) I get lost. When I search on Mozilla for sort_column it generates the following with no mention of pages, only posts:

    ‘sort_column’ => ‘menu_order post_title’,

    ‘depth’ => 5,

    ‘title_li’ => ”,

    ‘walker’ => new Walker_PageDescription() );

    wp_list_pages(apply_filters( ‘graphene_default_menu_args’, $args) );

    ?>

    <?php

    do_action( ‘graphene_default_menu’ );

    }

    endif;

    class Walker_PageDescription extends Walker_Page {

    /**

    * Code exact copied from: wp-includespost-template.pgp >> Walker_Page::start_el()

    * @since 2.1.0

    */

    function start_el(&$output, $page, $depth, $args, $current_page) {

    if ( $depth )

    $indent = str_repeat(“t”, $depth);

    else

    $indent = ”;

    extract( $args, EXTR_SKIP);

    $css_class = array( ‘page_item’, ‘page-item-‘.$page->ID)

Viewing 10 posts - 1 through 10 (of 32 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!