-
AuthorPosts
-
June 10, 2019 at 12:49 am #1108718
I had to change the order in my navigation menu, but the sidebar nav order did not update. I do have some tweaks in my child theme functions which I got from you to make the parent pages act as links. Here is the code I have in the functions.php. Please tell me what to change so the sort order will update to match the navigation:
function avia_sidebar_menu($echo = true)
{
$sidebar_menu = “”;$subNav = avia_get_option(‘page_nesting_nav’);
$the_id = @get_the_ID();
$args = array();
global $post;if($subNav && $subNav != ‘disabled’ && !empty($the_id) && is_page())
{
$subNav = false;
$parent = $post->ID;
$sidebar_menu = “”;if (!empty($post->post_parent))
{
if(isset($post->ancestors)) $ancestors = $post->ancestors;
if(!isset($ancestors)) $ancestors = get_post_ancestors($post->ID);
$root = count($ancestors)-1;
$parent = $ancestors[$root];
}$args = array(‘title_li’=>”, ‘child_of’=>$parent, ‘echo’=>0, ‘sort_column’=>’menu_order, post_title’);
//enables user to change query args
$args = apply_filters(‘avia_sidebar_menu_args’, $args, $post);//hide or show child pages in menu – if the class is set to ‘widget_nav_hide_child’ the child pages will be hidden
$display_child_pages = apply_filters(‘avia_sidebar_menu_display_child’, ‘widget_nav_hide_child’, $args, $post);$children = wp_list_pages($args);
$permalink = get_permalink($post->post_parent);if ($children)
{
$default_sidebar = false;
$sidebar_menu .= “<nav class=’widget widget_nav_menu $display_child_pages’>
<ul class=’nested_nav’>”;
$sidebar_menu .= ““.get_the_title( $post->post_parent ).”“;
$sidebar_menu .= $children;
$sidebar_menu .= ”
</nav>”;
}
}$sidebar_menu = apply_filters(‘avf_sidebar_menu_filter’, $sidebar_menu, $args, $post);
if($echo == true) { echo $sidebar_menu; } else { return $sidebar_menu; }
}
/* end add parent page to sidebar menu */June 10, 2019 at 1:15 am #1108720Nevermind. I found the Order field in the quick edit section, so was able to change the sidebar nav order manually.
June 10, 2019 at 4:14 am #1108733Hi,
Great, I’m glad that you found a solution and thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJune 10, 2019 at 4:19 pm #1108843You can close it. Thank you!
June 11, 2019 at 12:00 am #1108919Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Make Sidebar Nav Sort Order Match Nav Menu Order’ is closed to new replies.