Skip to content

Instantly share code, notes, and snippets.

@mattkeys
Last active August 29, 2015 14:15
Show Gist options
  • Save mattkeys/3cd83f3ff9ca5f62ce4c to your computer and use it in GitHub Desktop.
Save mattkeys/3cd83f3ff9ca5f62ce4c to your computer and use it in GitHub Desktop.
Syntax Error
<?php
if ( is_active_nav_menu( 'primary' ) ) {
$divider_html = '';
wp_nav_menu( array(
'theme_location' => 'primary', // Setting up the location for the main-menu, Main Navigation.
'menu_class' => 'dropdown', //Adding the class for dropdowns
'divider_html' => $divider_html,
'container_id' => 'navwrap', //Add CSS ID to the containter that wraps the menu.
'fallback_cb' => 'wp_page_menu', //if wp_nav_menu is unavailable, WordPress displays wp_page_menu function, which displays the pages of your blog.
)
);
} else {
$curr_menu_class = 'current-menu-item current_page_item';
$curr_menu_parent_class = 'current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment