• Resolved dbazhinov

    (@dbazhinov)


    Hey nice plugin!

    I want to add this to the menu of my theme. Only the shortcode is provided, what’s the print? Anything I’ve tried doesn’t work.

    Thanks!

    • This topic was modified 6 years, 4 months ago by dbazhinov.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dbazhinov

    (@dbazhinov)

    Ah, I figured out I can use this:
    <?php echo do_shortcode("[buddy_notification_bell]"); ?>

    Unfortunately my menu looks something like this and I’m not sure how to add that shortcode as the last “li”.. Any idea?

                <!-- Navigation -->
                <?php wp_nav_menu( array(
                        'theme_location'    => 'header',
                        'depth'             => 3,
                        'container'         => 'div',
                        'container_class'   => 'navbar-collapse collapse',
                        'menu_class'        => 'nav navbar-nav navbar-right menu-header',
                        'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                        'walker'            => new wp_bootstrap_navwalker()
                        )
                    );
                ?>
                <!-- /Navigation -->
    • This reply was modified 6 years, 4 months ago by dbazhinov.
    Thread Starter dbazhinov

    (@dbazhinov)

    Figured it out. Used this: https://www.wpbeginner.com/wp-themes/how-to-add-custom-items-to-specific-wordpress-menus/

    Basically.. just change the NAME-HERE to something and add to functions.php

    add_theme_support( 'menus' );
    add_filter( 'wp_nav_menu_items', 'NAME-HERE', 10, 2 );
    function NAME-HERE ( $items, $args ) {
            $items .= '<li>' . do_shortcode("[buddy_notification_bell]") . '</li>';
        return $items;
    }
    Plugin Author 1naveengiri

    (@1naveengiri)

    That’s Great, I am happy you found the solution.
    Keep learning ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What’s the print code to add to my theme?’ is closed to new replies.