';
+ }
+ ?>
+
+
+
diff --git a/inc/nav-walker.php b/inc/nav-walker.php
index 9135f45..599580f 100644
--- a/inc/nav-walker.php
+++ b/inc/nav-walker.php
@@ -1,358 +1,374 @@
-
- *
- * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
- * So basically add one to what you'd expect it to be
- */
- function start_lvl(&$output, $depth, $args)
- {
- if(isset($args->with_search) && $args->with_search == true){
- add_filter('wp_nav_menu_items', 'search_menu_item', 1, 2);
- }
-
- $tabs = str_repeat("\t", $depth);
- // If we are about to start the first submenu, we need to give it a dropdown-menu class
- if ($depth >= 0) { //really, level-1 or level-2, because $depth is misleading here (see note above)
- $output .= "\n{$tabs}
\n";
- } else {
- $output .= "\n{$tabs}
\n";
- }
- return;
- }
-
- /* End of the
- *
- * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
- * So basically add one to what you'd expect it to be
- */
- function end_lvl(&$output, $depth)
- {
- if ($depth == 0) { // This is actually the end of the level-1 submenu ($depth is misleading here too!)
-
- // we don't have anything special for Bootstrap, so we'll just leave an HTML comment for now
- $output .= '';
- }
- $tabs = str_repeat("\t", $depth);
- $output .= "\n{$tabs}
';
- return;
- }
-
- /* Add a 'hasChildren' property to the item
- * Code from: http://wordpress.org/support/topic/how-do-i-know-if-a-menu-item-has-children-or-is-a-leaf#post-3139633
- */
- function display_element ($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
- {
- /* if($element->post_type == 'page' && !isset($children_elements[$element->ID])) {
-
- $children = get_children(array('post_parent' => $element->ID, 'numberposts' => -1, 'post_type' => 'page'));
- $children_elements[$element->ID] = $children;
- }*/
- // check whether this item has children, and set $item->hasChildren accordingly
- $element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
-
- //var_dump($children_elements);
-// var_dump($element);
- /*if($element->hasChildren) {
- $element2 = $children_elements[$element->ID];
- $child2 = $children_elements[$element2->ID];
- $element2->hasChildren = isset($child2[$element2->ID]) && !empty($child2[$element2->ID]);
- }*/
- // continue with normal behavior
- return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
- }
- }
-}
-/*Nav Menu Walker*/
-if(!class_exists('Secondary_Bootstrap_Nav_Walker')) {
- class Secondary_Bootstrap_Nav_Walker extends Walker_Nav_Menu {
- /*This was taken from 320press WP-Bootstrap theme. No licensing restriction given, and it said it was free. */
- /* Start of the
- *
- * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
- * So basically add one to what you'd expect it to be
- */
- function start_lvl(&$output, $depth, $args)
- {
- if(isset($args->with_search) && $args->with_search == true){
- add_filter('wp_nav_menu_items', 'search_menu_item', 1, 2);
- }
-
- $tabs = str_repeat("\t", $depth);
- // If we are about to start the first submenu, we need to give it a dropdown-menu class
- if ($depth >= 0) { //really, level-1 or level-2, because $depth is misleading here (see note above)
- $output .= "\n{$tabs}
\n";
- } else {
- $output .= "\n{$tabs}
\n";
- }
- return;
- }
-
- /* End of the
- *
- * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
- * So basically add one to what you'd expect it to be
- */
- function end_lvl(&$output, $depth)
- {
- $tabs = str_repeat("\t", $depth);
- $output .= "\n{$tabs}
+ *
+ * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
+ * So basically add one to what you'd expect it to be
+ */
+ function start_lvl(&$output, $depth, $args)
+ {
+ if(isset($args->with_search) && $args->with_search == true){
+ add_filter('wp_nav_menu_items', 'search_menu_item', 1, 2);
+ }
+
+ $tabs = str_repeat("\t", $depth);
+ // If we are about to start the first submenu, we need to give it a dropdown-menu class
+ if ($depth >= 0) { //really, level-1 or level-2, because $depth is misleading here (see note above)
+ $output .= "\n{$tabs}
\n";
+ } else {
+ $output .= "\n{$tabs}
\n";
+ }
+ return;
+ }
+
+ /* End of the
+ *
+ * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
+ * So basically add one to what you'd expect it to be
+ */
+ function end_lvl(&$output, $depth)
+ {
+ if ($depth == 0) { // This is actually the end of the level-1 submenu ($depth is misleading here too!)
+
+ // we don't have anything special for Bootstrap, so we'll just leave an HTML comment for now
+ $output .= '';
+ }
+ $tabs = str_repeat("\t", $depth);
+ $output .= "\n{$tabs}
';
+ return;
+ }
+
+ /* Add a 'hasChildren' property to the item
+ * Code from: http://wordpress.org/support/topic/how-do-i-know-if-a-menu-item-has-children-or-is-a-leaf#post-3139633
+ */
+ function display_element ($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
+ {
+ /* if($element->post_type == 'page' && !isset($children_elements[$element->ID])) {
+
+ $children = get_children(array('post_parent' => $element->ID, 'numberposts' => -1, 'post_type' => 'page'));
+ $children_elements[$element->ID] = $children;
+ }*/
+ // check whether this item has children, and set $item->hasChildren accordingly
+ $element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
+
+ //var_dump($children_elements);
+// var_dump($element);
+ /*if($element->hasChildren) {
+ $element2 = $children_elements[$element->ID];
+ $child2 = $children_elements[$element2->ID];
+ $element2->hasChildren = isset($child2[$element2->ID]) && !empty($child2[$element2->ID]);
+ }*/
+ // continue with normal behavior
+ return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
+ }
+ }
+}
+/*Nav Menu Walker*/
+if(!class_exists('Secondary_Bootstrap_Nav_Walker')) {
+ class Secondary_Bootstrap_Nav_Walker extends Walker_Nav_Menu {
+ /*This was taken from 320press WP-Bootstrap theme. No licensing restriction given, and it said it was free. */
+ /* Start of the
+ *
+ * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
+ * So basically add one to what you'd expect it to be
+ */
+ function start_lvl(&$output, $depth, $args)
+ {
+ if(isset($args->with_search) && $args->with_search == true){
+ add_filter('wp_nav_menu_items', 'search_menu_item', 1, 2);
+ }
+
+ $tabs = str_repeat("\t", $depth);
+ // If we are about to start the first submenu, we need to give it a dropdown-menu class
+ if ($depth >= 0) { //really, level-1 or level-2, because $depth is misleading here (see note above)
+ $output .= "\n{$tabs}
\n";
+ } else {
+ $output .= "\n{$tabs}
\n";
+ }
+ return;
+ }
+
+ /* End of the
+ *
+ * Note on $depth: Counterintuitively, $depth here means the "depth right before we start this menu".
+ * So basically add one to what you'd expect it to be
+ */
+ function end_lvl(&$output, $depth)
+ {
+ $tabs = str_repeat("\t", $depth);
+ $output .= "\n{$tabs}