From f22328cbef5d4864c3741aaaad9e9b0a9238f936 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 5 Nov 2019 19:23:52 -0500 Subject: [PATCH] Only disable top-level nav items if they possess no children. --- header.php | 2 +- js/app.js | 4 +++- js/custom/pageSetup.js | 4 +++- style.css | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/header.php b/header.php index eb0deb2..505518a 100644 --- a/header.php +++ b/header.php @@ -5,7 +5,7 @@ <?php wp_title(); ?> - + diff --git a/js/app.js b/js/app.js index 728ccfa..10f8828 100644 --- a/js/app.js +++ b/js/app.js @@ -12,7 +12,9 @@ $(document).foundation(); $(document).ready(function () { var main_nav_top_items = $('.top-bar-section > ul').children("li"); main_nav_top_items.each(function() { - $(this).children("a").attr("href", "#"); + if ($(this).hasClass('menu-item-has-children')) { + $(this).children("a").attr("href", "#"); + } }); $('ul.children').each(function () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index bdf5c03..dea262b 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -3,7 +3,9 @@ $(document).foundation(); $(document).ready(function () { var main_nav_top_items = $('.top-bar-section > ul').children("li"); main_nav_top_items.each(function() { - $(this).children("a").attr("href", "#"); + if ($(this).hasClass('menu-item-has-children')) { + $(this).children("a").attr("href", "#"); + } }); $('ul.children').each(function () { diff --git a/style.css b/style.css index 966e019..dbf59fd 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: FineWineJourneys Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for FineWineJourneys -Version: 1.0.1.0 +Version: 1.0.2.0 */ -- 2.17.1