FoundationNavWalker icon indicating copy to clipboard operation
FoundationNavWalker copied to clipboard

A simple extension of wp_nav_menu to support Foundation 5's offcanvas nav

Foundation nav walker for WordPress

This is a simple extension of WordPress' built in wp_nav_menu to give support for Foundation 5's offscreen nav

Installation

Copy the full contents of the file into your functions.php file, or copy the file to your theme directory and call it from functions.php with require get_template_directory() . '/FoundationNavWalker.class.php';

Normal usage within a theme

<?php
	$defaults = array(
		'container'   => false,
		'menu_class'  => 'off-canvas-list',
		'walker'      => new FoundationNavWalker()
	);

	wp_nav_menu( $defaults );
?>