WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Menu Widget
[resolved] shortcode (1 post)

  1. coimbramatos
    Member
    Posted 2 years ago #

    Just sharing a simple shortcode i made for the plug-in. It works, but still need lots of development.

    // shortcode => [advMenu id=N]
    function advMenu_func( $atts ) {
    	extract( shortcode_atts( $atts ) );
    	$id = ( isset( $id ) )? $id : false;
    	if(!$id) return '<strong>[advMenu id=N]</strong> id is required';
    	$args = array(
    		'menu' => $id,
    		'container'       => 'div',
    		'container_class' => 'sub-menu-container'
    	);
    	wp_nav_menu( $args );
    }
    add_shortcode( 'advMenu', 'advMenu_func' );

    http://wordpress.org/extend/plugins/advanced-menu-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic