Wednesday, June 12, 2013

How Can I add a WordPress menu to the content of my page?

function content_menu_shortcode($atts, $content = null) {
extract(shortcode_atts(array( 'name' => null, ), $atts));
return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) );
}
add_shortcode('menu', 'content_menu_shortcode');
[menu name="content-menu"]

No comments:

Post a Comment