Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active July 13, 2017 13:10
Show Gist options
  • Save rachelmccollin/679562c73f73b924ba330950c42f8dca to your computer and use it in GitHub Desktop.
Save rachelmccollin/679562c73f73b924ba330950c42f8dca to your computer and use it in GitHub Desktop.
WPMU DEV Automated Navigation Menus
$args = array(
'depth' => 2
);
$args = array(
'depth' => 2,
'title_li' => '<h3>' . __( 'Menu', 'wpmu' ) . '</h3>',
'sort_column' => 'menu-order'
);
<?php
if ( function_exists( 'wpmu_list_pages' ) ) {
wpmu_list_pages();
}
else {
wp_nav_menu( array(
'theme_location' => 'top',
'menu_id' => 'top-menu',
) );
}
?>
<?php
/**
* Plugin Name: WPMU DEV Automated Navigation Menus
* Plugin URI: https://github.com/rachelmccollin/wpmudev-automated-menus
* Description: Plugin to accompnay WPMU DEV post on automating navigation and section menus
* Version: 1.0
* Author: Rachel McCollin
* Author URI: http://rachelmccollin.co.uk
*
*/
/*
Theme Name: WPMU DEV Automated Navigation Menus
Theme URI: https://github.com/rachelmccollin/wpmudev-automated-menus
Description: Theme to support WPMU DEV post on automating navigation and section menus. Child theme for the Twenty Seventeen theme.
Author: Rachel McCollin
Author URI: http://rachelmccollin.co.uk/
Template: twentyseventeen
Version: 1.0
*/
@import url("../twentyseventeen/style.css");
<?php wp_nav_menu( array(
'theme_location' => 'top',
'menu_id' => 'top-menu',
) ); ?>
wpmu_list_pages() {
$args = array(
'depth' => 2
);
}
wp_list_pages( $args );
wpmu_list_pages() {
$args = array(
'depth' => 2
);
wp_list_pages( $args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment