Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to insert shortcode into Nav menu

  • Avatar of admin25
    admin25
    Participant

    @admin25

    Hello, I have made a menu item with the following code.

    The menu item shows up but the shortcode output is not there.

    Is there something I can add or a different method that will do this.

    `//–Nav Menu
    function add_profile_link_to_nav(){
    if ( is_user_logged_in() ) { ?>


    <?php }
    }
    add_action( “bp_menu”,”add_profile_link_to_nav” );

    function custom_execute_shortcode() {
    $myfunction= ‘[my shortcode"]‘;
    $myfunction_parsed = do_shortcode($myfunction);
    return $myfunction_parsed;
    }`

    I have also added
    `add_filter(‘bp_menu’, ‘do_shortcode’, 7);`
    in hopes this might help.

    Thanks for any help or insight.

You must be logged in to reply to this topic.