Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on Single Page WordPress Theme where I want to get_pages() as per custom menu order.

I have gone through the reference for get_pages() which only allows for default menu :

get_pages('sort_order=asc&sort_column=menu_order');

Is there any way to get_pages() as per custom menu order ?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

I Have Found My Own Solution. I Tried To Get Page ID Of Each Custom Menu Item & Rendered Page Based On That ID.

Reference : wp get nav menu items

Like This...

    $menu_name = 'primary-menu';

    if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
            $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
            $menu_items = wp_get_nav_menu_items($menu->term_id);
            foreach ( (array) $menu_items as $key => $menu_item ) {
                $qcPageID = $menu_item->object_id;
                $qcPageData = get_page( $qcPageID );
            }
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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