0

It's using a superceded theme with no support. Even so, the theme has been working great for about a decade...

Here is the site: https://www.vertebr.ae

There is no menu to organise in the appearance settings. This theme orders them alphabetically using this code (I think)

    function greenday_get_menu_from_pages() {

    $pages = & get_pages($args);
    if ( $pages ) {

        foreach ($pages as $page) {
            $output = '<li><a href="' . get_page_link($page->ID) . '">' . $page->post_title . '</a></li>';
            echo $output;
        }
    }

}

&

<?php    greenday_get_menu_from_pages();    ?>

I have specified the page ordering with numbers in the page attributes; there is no effect. I have tried several "page ordering" plugins but they all fail to do the job.

I vaguely remember I was using html spaces to organise the pages ages back, that's not a great workaround anymore as there are too many items in the navigation menu.

&nbsp; 

The pages appear in the correct order in the wordpress admin...

This is my preferred order:

  • About Design Products Reviews Gallery Philosophy FAQ News Contact

I am not a programmer so it is beyond my capabilities to code from scratch although I can copy/paste/edit if someone has a workaround... :-/

0

I suggest you change code of your greenday_get_menu_from_pages() function a little bit, just so that the results are not ordered by post_title which is default for get_pages(), but ordered by menu_order, which is what most "page ordering" plugins you have tested actually work with.

So here is one new line in your function:

function greenday_get_menu_from_pages() {

    $args = array('sort_column' => 'menu_order');

    $pages = get_pages($args);
    if ( $pages ) {

        foreach ($pages as $page) {
            $output = '<li><a href="' . get_page_link($page->ID) . '">' . $page->post_title . '</a></li>';
            echo $output;
        }
    }

}

And then, you can install plugin such as Intuitive Custom Post Order, go to Settings > Intuitive CPO - set it up to be available for Pages as you can see on this screen:

Intuitive Custom Post Order Settings

And then, go to your Pages tab and simply drag and drop the entries there.

Side note: i've also removed the ampersand & for reference before your get_pages() call, not sure if that was any important, seemed rather obsolete to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.