diff --git a/functions.php b/functions.php index 4742db3e38..bfb84adeda 100644 --- a/functions.php +++ b/functions.php @@ -17,7 +17,6 @@ 'lib/config.php', // Configuration 'lib/assets.php', // Scripts and stylesheets 'lib/titles.php', // Page titles - 'lib/nav.php', // Custom nav modifications 'lib/extras.php', // Custom functions ]; diff --git a/lib/config.php b/lib/config.php index 073b15a574..20c16bc8d0 100644 --- a/lib/config.php +++ b/lib/config.php @@ -8,6 +8,7 @@ * Enable theme features */ add_theme_support('soil-clean-up'); // Enable clean up from Soil +add_theme_support('soil-nav-walker'); // Enable cleaner nav walker from Soil add_theme_support('soil-relative-urls'); // Enable relative URLs from Soil add_theme_support('soil-nice-search'); // Enable nice search from Soil add_theme_support('soil-jquery-cdn'); // Enable to load jQuery from the Google CDN diff --git a/lib/nav.php b/lib/nav.php deleted file mode 100644 index 8895162fc7..0000000000 --- a/lib/nav.php +++ /dev/null @@ -1,122 +0,0 @@ -Home - *
  • Sample PageHome
  • - * - */ -class NavWalker extends \Walker_Nav_Menu { - private $cpt; // Boolean, is current post a custom post type - private $archive; // Stores the archive page for current URL - - public function __construct() { - add_filter('nav_menu_css_class', array($this, 'cssClasses'), 10, 2); - add_filter('nav_menu_item_id', '__return_null'); - $cpt = get_post_type(); - $this->cpt = in_array($cpt, get_post_types(array('_builtin' => false))); - $this->archive = get_post_type_archive_link($cpt); - } - - public function checkCurrent($classes) { - return preg_match('/(current[-_])|active|dropdown/', $classes); - } - - // @codingStandardsIgnoreStart - function start_lvl(&$output, $depth = 0, $args = []) { - $output .= "\n