• Resolved Alex Kladov

    (@prowebassist)


    Hi,

    I am having issues with the shortcode that Quadmenu comes with – [quadmenu theme_location="primary-menu" theme="default_theme"]. When I add it to the page, the menu doesn’t get inserted exactly where I place the shortcode (as one would expect, based on how most shortcodes work). Instead, the menu gets somehow “ripped out” of the original page structure and placed on top of the page instead, just above the header html element.

    Nor does it work if I try to enable Quadmenu using Quadmenu settings. For example, let’s say I leave secondary-menu OFF, but want to enable Quadmenu for primary-menu. So I enable Quadmenu only for the primary-menu location like this. But Quadmenu still gets enabled on all menus I have on my page, even non-primary ones. It’s very strange.

    I am using latest version of WP & Quadmenu + Divi theme. I’ve tried installing QuadMenu – Divi Mega Menu plugin, but it didn’t help either.

    Also, not sure if it matters, but I am using the new Divi Theme Builder feature to build my header (Divi v4+) + Divi’s regular Menu module to place menu in the right place. What that means is that I can’t just manually place the Quadmenu using header.php file, since the website Header is built using the new Divi Theme Builder.

    Regards,
    Alex

    • This topic was modified 4 years, 11 months ago by Alex Kladov. Reason: fixed typos
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author quadlayers

    (@quadlayers)

    hello
    to integrate quadmenu in divi, you can use the divi module
    https://quadmenu.com/documentation/integration/divi
    kind regards

    Thread Starter Alex Kladov

    (@prowebassist)

    Or just fix your shortcode.. the only problem with it is that it ignores the menu location a user specifies via theme_location (see line 33 in includes/frontend/integration.php).

    For now I had to create my own shortcode just to bypass your broken one, which is very redundant. Here is a code if anyone is interested:

    
    // Fix broken Quadmenu shortcode (quadmenu/includes/frontend/integration.php)
    add_shortcode( 'quadmenu_custom', function( $atts, $content = null ) {
      extract( shortcode_atts( array(
        'echo'           => 'false',
        'theme'          => 'default_theme',
        'theme_location' => '',
        'sticky'         => 1,
      ), $atts ) );
    
      $args = array(
        'echo'           => $echo == 'false' ? false : true,
        'theme'          => $theme,
        'theme_location' => $theme_location,
        'sticky'         => $sticky == 1 ? 1 : 0,
      );
    
      // Echo Quadmenu
      if ( function_exists( 'is_quadmenu_location' ) && is_quadmenu_location( $theme_location ) ) {
        return quadmenu( $args );
      }
    } );
    

    Here is how you use it: [quadmenu_custom theme='my-quadmenu-theme' theme_location="custom-menu-location"]

    • This reply was modified 4 years, 10 months ago by Alex Kladov. Reason: typos
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Quadmenu shortcode doesn’t insert the menu in the right place’ is closed to new replies.