I Changed the Menu Order, But the Page Order Didn't Change on Front Page

First-timer here! I'm trying to change the order of pages on my boardgame webpage, as displayed on the top banner www.mangakagame.com .

Basically, I've used "Edit" in the Dashboard and adjusted all the "order" attributes, but nothing changes. It's still using chronological ordering. The "Simple Page Ordering" plugin didn't do anything either.

Weirder still, I tried to set one of the pages to "Private" but it still shows up in the banner! :/ It just links to an "Oops! That page can not be found." So I had to set it to public again, at least temporarily...

I assume this may be due to something in the WP theme I'm using (Auberge), but I can't figure it out. If this requires fiddling with the actual CSS, I don't even know where to begin. If anyone has any suggestions, I'd be super grateful.

Many thanks,

Jason (@mockman)

Topic menu-order order pages Wordpress

Category Web


By default, posts and pages are sorted after the date. If you want sort pages by "order" field, which is visible on edit page, you have to set orderby parameter:

add_action('pre_get_posts', 'change_order');

function change_order($query) {
    if ( is_front_page() || is_home() ) {
        $query->set( 'orderby', 'menu_order' );
        $query->set( 'order', 'ASC' );
    }
    return $query;
}

Put code in functions.php file. More about orderby parameters you will find here.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.