Skip to content

Instantly share code, notes, and snippets.

View mirkoschubert's full-sized avatar

Mirko Schubert mirkoschubert

View GitHub Profile
wp_nav_menu(array('theme_location' => 'primary'));
register_nav_menus(array(
'primary' => __('Primary Menu', 'textdomain' ),
'secondary' => __('Secondary Menu', 'textdomain' )
));
@mirkoschubert
mirkoschubert / functions.php
Last active August 29, 2015 14:23
WordPress Footer Navigation as String
if (!function_exists('theme_footer_menu')) :
function theme_footer_menu($args = array('theme_location' => 'secondary', 'seperator' => '•')) {
$args['seperator'] = ($args['seperator'] != '') ? ' ' . $args['seperator'] . ' ' : ' ';
if ($args['theme_location'] == '') {
return false;
} else {
if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args['theme_location'] ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $args['theme_location'] ] );
$menu_items = wp_get_nav_menu_items($menu->term_id);