I have made a menu in the admin page ordered like this:
parent - child 1 - child 2 - child 3 parent - child 1 - child 2 - child 3 parent - child 1 - child 2 - child 3
When I load them in my navbar with the following code it works just fine:
wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu', 'menu_class' => 'top-menu', ) );
However, I want to load a specific menu on a page based on it's parent. I have done this as followed:
<?php $children = get_posts( array( 'post_parent' => $parent, 'post_type' => 'page', 'numberposts' => 9, 'orderby' => 'menu_order', 'order' => 'ASC')); ?>
But when it is displayed it displays the menu according to their publishing date:
- child 2 - child 1 - child 3
I know I can just change the publishing date but this may conflict in the future.
How do I order these children the same way as I have in the navbar?