[Support request] Tom's megamenu…

Home Forums Support [Support request] Tom's megamenu…

Home Forums Support Tom's megamenu…

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #832130
    John

    Did a quick search on the forum, and didn’t find my issue mentioned.

    I just implemented Tom’s simple megmenu and shortcoded it. \

    It shows up, so that’s a win. But not as described in the docs… it is a fully-displayed vertical ul/li, rather than the horizontal tab the docs show.

    Help?

    I’ll leave it up for a while at the link below 😉

    #832272
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure what you mean by shortcoded it?

    The code should work if it’s applied in GP’s default primary or secondary navigation.

    If you are referring to the menu at the bottom of the page you linked, it’s added with Thrive so that’s likely the problem.

    Maybe check with their support to see if they have any recommendation for a mega menu.

    #832382
    John

    Fair enough. Thrive allows inclusion of HTML as an element, but whatever.

    I’ve moved the ‘short code’ to a non-thrive page: https://h2only.ca/basepage1/
    The result: Exactly the same.

    PS: the ‘short code’ is generated by this code in functions.php:

    /* Menu Shortcode */
    	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'); 
    
    /* use shortcode [menu name="your-menu-name"] */
    /* ---------------------------*/

    Am I trying too hard? Is there an easier way?

    #832386
    John

    The code should work if it’s applied in GP’s default primary or secondary navigation.

    Is it limited to that? And if so: can I use the ‘secondary nav’ option as a custom menu?

    #832437
    Leo
    Staff
    Customer Support

    So you want to move the secondary navigation towards the bottom?

    #832706
    John

    Just to clarify: the Simple Megamenu only works within the confines of GP. Can it be hooked?

    If so, I may have to rethink my process on this project a bit.

    #833125
    Tom
    Lead Developer
    Lead Developer

    The code we provide only works with the structure of our menu. In your case, you’ve added the menu inside the content, so it’s missing the bulk of the necessary HTML to become the horizontal nav.

    You could maybe try this:

    add_shortcode( 'navigation', function() {
        ob_start();
    
        if ( function_exists( 'generate_navigation_position' ) ) {
            generate_navigation_position();
        }    
    
        return ob_get_clean();
    } );
    #833145
    John

    Woo-hoo! Thanks a bunch!

    Made one small change to the above:
    add_shortcode( 'navigation'
    got changed to
    add_shortcode( 'menu'

    Gives me the top level as hoped for… but no second-level, nor does it allow drop down. Clues on that?

    ===

    Oops. Spoke too soon. It renders the primary nav object, rather than my custom one.

    #833382
    Tom
    Lead Developer
    Lead Developer

    Ah yes, that code will render the primary navigation.

    You would need some pretty considerable CSS to add mega menu functionality to a custom menu. Have you looked at any fo the available mega menu plugins?

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.