diff --git a/inc/template-functions.php b/inc/template-functions.php index e174c8b1..d1e7bb37 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -111,23 +111,6 @@ function uw_list_pages( $mobile = false ) $ids = ! is_front_page() ? array_map( function($sibling) { return $sibling->ID; }, $siblings ) : array(); - $args1 = array( - 'child_of' => $post->ID, - 'post_type' => 'page', - 'post_status' => 'publish', - 'depth' => 1 - ); - $children_array = get_pages( $args1 ); - $count = 0; - foreach($children_array as $children) { - $hidden = get_post_meta($children->ID, "parent", true); - if ( ($hidden == "on") || ( in_array($children->post_parent, $ids) ) ) { //problem causer! - $ids[] = $children->ID; - } else { - $count++; - } - } - $pages = wp_list_pages(array( 'title_li' => 'Home', 'child_of' => $parent->post_parent, @@ -137,7 +120,7 @@ function uw_list_pages( $mobile = false ) 'walker' => $UW->SidebarMenuWalker )); - return ( $pages && $count!=0 ) ? sprintf( '%s', $toggle, $class, $pages ) : ''; + return $pages ? sprintf( '%s', $toggle, $class, $pages ) : ''; } diff --git a/setup/class.uw-sidebar-menu-walker.php b/setup/class.uw-sidebar-menu-walker.php index b2ed5aaf..aebf662d 100644 --- a/setup/class.uw-sidebar-menu-walker.php +++ b/setup/class.uw-sidebar-menu-walker.php @@ -65,8 +65,17 @@ public function start_el( &$output, $page, $depth = 0, $args = array(), $current apply_filters( 'the_title', $page->post_title, $page->ID ), $args['link_after'] ); - } else if ($parent[0]!="on") { - $output .= $indent . sprintf( + } else if ($parent[0] === "on" && $depth != 0) { + // $output .= $indent . sprintf( + // '
  • %s%s%s', + // $css_classes, + // get_permalink( $page->ID ), + // $args['link_before'], + // apply_filters( 'the_title', $page->post_title, $page->ID ), + // $args['link_after'] + // ); + } else { + $output .= $indent . sprintf( '
  • %s%s%s', $css_classes, get_permalink( $page->ID ),