• I am using a shortcode I created to pull my main nav menu into an area on my testimonials page. It seems to work, except it strips out all of the styling. How can I fix this?

    Here is the page:
    https://creatingpositivefutures.com/testimonials-new/

    Here is the code I am using:

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

    Shortcode is: [menu name="main"]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try adding container_class with fusion-main-menu on the shortcode.

    function print_menu_shortcode($atts, $content = null) {
        extract(shortcode_atts(array( 'name' => null, ), $atts));
        return wp_nav_menu( array( 'menu' => $name, 'echo' => false, 'container_class' => 'fusion-main-menu' ) );
    }
    add_shortcode('menu', 'print_menu_shortcode');

    Cheers,
    Septian

    • This reply was modified 8 years, 4 months ago by hxh90.
    • This reply was modified 8 years, 4 months ago by hxh90.
    Thread Starter Squidpeg9

    (@squidpeg9)

    Thanks! Will try.

    • This reply was modified 8 years, 4 months ago by Squidpeg9.
    Thread Starter Squidpeg9

    (@squidpeg9)

    Ok that almost did it – applied the inline and all, now just need to get rid of the bullet points. I added ‘menu_class’ => ‘fusion-menu’ and ‘menu_id’ => ‘menu-main’, but neither seems to help. Any ideas?

    Thread Starter Squidpeg9

    (@squidpeg9)

    Does anyone else have any ideas on this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Menu Shortcode’ is closed to new replies.