WordPress.org

Ready to get started?Download WordPress

Forums

JQuery Mega Menu Widget
[resolved] Displaying menu not as a widget, but at the top main menu (64 posts)

  1. jasonpaulweber
    Member
    Posted 1 year ago #

    I noticed on the designchemical website, a person asked:

    Hi, how can i set your megamenu, like the main menu of my site?

    Your response was:

    Just follow the instructions on the plugin home page. It should contain all the info required to set up a standard drop down menu

    I'm not really understanding your response -- well, at least where the instructions are on the plugin home page (which is where it was asked, I believe).

    Basically, I'd like this not to show up in the sidebar widget - I'd like it to replace my current custom menu in my header! Is this possible? I hope it is; I really like this plugin.

    Thanks!

    http://wordpress.org/extend/plugins/jquery-mega-menu/

  2. jasonpaulweber
    Member
    Posted 1 year ago #

    I read more into the documentation, and created a widget area just after the header, and have things working perfectly now.

    So this issue is resolved. 5 stars in my book -- wonderful job, and thanks for sharing!

    Jason

  3. mvaughn88
    Member
    Posted 1 year ago #

    Jason, I'm new to this whole WordPress world, can you point me to the documentation you used to create a widget area just after the header. Do you also have to remove the current menu from your theme? Is it a free theme or one purchased?

  4. jasonpaulweber
    Member
    Posted 1 year ago #

    1. Go into your Wp-Admin
    2. Go to Appearances >> Editor
    3. Find the file functions.php
    4. Before the closing ?>, add the following lines of code:
      if ( function_exists('register_sidebar') ){
      register_sidebar(array(
      'name' => 'my_mega_menu',
      'before_widget' => '<div id="my-mega-menu-widget">',
      'after_widget' => '</div>',
      'before_title' => '',
      'after_title' => '',
      ));
      }
    5. Now edit the header.php file
    6. Find the location where you want to place the menu and add the following code to the header.php file:
      <?php /* Widgetized sidebar */
      if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>

    Save all the changes, and you should now be able to go into Appearances >> Widgets >> My_Mega_Menu_Widget and then drag the jquery_mega_menu widget into the my_mega_menu_widget box.

    For more information, see Design Chemical's documentation on how to create the new widget area, although it just says what I just wrote.

  5. mvaughn88
    Member
    Posted 1 year ago #

    Ok I did find the doc that has that but when i try to use it with the theme I get red lines when I add the under the php endif

  6. mvaughn88
    Member
    Posted 1 year ago #

    my bad got it to work!

    [Please stop posting in uppercase & shouting at us. Post de-capped.]

  7. Douby
    Member
    Posted 1 year ago #

    it still doesn't work. And I don't know why...

    My website http://dungeon-rpg.com/

  8. jasonpaulweber
    Member
    Posted 1 year ago #

    Need more information that that Douby ... are you following the instructions precisely as I just explained to Mvaughn?

  9. Douby
    Member
    Posted 1 year ago #

    I did this :

    Go into your Wp-Admin
    Go to Appearances >> Editor
    Find the file functions.php
    Before the closing ?>, add the following lines of code:
    if ( function_exists('register_sidebar') ){
    register_sidebar(array(
    'name' => 'my_mega_menu',
    'before_widget' => '<div id="my-mega-menu-widget">',
    'after_widget' => '</div>',
    'before_title' => '',
    'after_title' => '',
    ));
    }
    Now edit the header.php file
    Find the location where you want to place the menu and add the following code to the header.php file:
    <?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>

    exactly this, i add my code to see the result and that doesn't work. I have a simple list the same that wordpress do already with "menu".

  10. nitinpant
    Member
    Posted 1 year ago #

    I have a similar issue. I added both the snippets into places but I cannot get an additional widget area!

  11. SQSBMedia
    Member
    Posted 1 year ago #

    I have attempted the fix provided by jasonpaulweber and can almost get this working but not quite. It places it on the page but in the incorrect spot, no matter where I place the code. I am using the attitude theme. Does anyone know where I would place this code to replace the main menu for that theme? I have a slider and it either wants to place the menu at the top of the page or below the slider.

  12. jasonpaulweber
    Member
    Posted 1 year ago #

    Places what on the page? The image? Then you'll need to adjust the sizes or margins. Also, you should be using the pictures on your level 2 menu items.

    Can you please provide a link so I can Firebug it and see what's going on?

  13. jasonpaulweber
    Member
    Posted 1 year ago #

    Yes, Douby ... designchemical says right on their website how to add a widget area for the mega menu .... But getting the pictures to display requires a little tinkering, and putting the pictures on your 2nd level menu items.

  14. SQSBMedia
    Member
    Posted 1 year ago #

    My apologies, I should have been more clear. I was speaking of the entire menu. No matter where I place the recommended code:

    <?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>

    in the header.php file, it either places the menu below the slider or at the top of the page and leaves the primary navigation as is.

    Here is a link: http://dev.squarescrub.com/square_scrub/

    Thanks for your help!

  15. jasonpaulweber
    Member
    Posted 1 year ago #

    Can you send me your header.php? My e-mail is my username @ gmail dot com ... unless you post it in here using Pastebin.

    Somewhere in your header.php is your regular menu. You'll need to replace that with the widgetized mega menu. But if you send me your header.php, I'll do it. Just keep a backup of the file so you can always revert.

  16. remix4
    Member
    Plugin Author

    Posted 1 year ago #

    @jasonpaulweber thanks for the help!

  17. asianfantasy
    Member
    Posted 1 year ago #

    iT WORKS!!!

    THANKS A LOT @jasonpaulweber.

    I'm building a site named asianfantasy where I was struggling to find a nav solution but I'm free to mess around :)

    Thanks man.

  18. jasonpaulweber
    Member
    Posted 1 year ago #

    Looks good! Don't forget to adjust your margins in your css, or for an easier fix, just check "Set Sub Menu To Full Width".

    Glad you have it working!

  19. mrmccarrin
    Member
    Posted 1 year ago #

    Hi - I have been trying to get this to work as well and it does not seem to be working for me even after I edited the function.php and header.php. I was wondering if you could help me as well my site is:

    http://www.meganrmccarrin.com

    Thank you!

  20. mrmccarrin
    Member
    Posted 1 year ago #

    My problem seems to be that No matter where I place the recommended code:

    <?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>

    in the header.php. It does not move from a sidebar.

    Thank you.

  21. jasonpaulweber
    Member
    Posted 1 year ago #

    Most likely it has something to do with your theme ... All you really need in there is like ...

    <?php dynamic_sidebar('my_mega_menu'); ?>

    I see you've added the css and js, but do you have a custom menu that is 3 tiered? So without seeing your custom menu you've made, and without knowing your theme, it's difficult to say what's causing the behavior of no mega menu showing up.

  22. jasonpaulweber
    Member
    Posted 1 year ago #

    If your dropdown menus aren't showing, make sure your theme's stylesheet doesn't have the tags "overflow:hidden;" around them. If they do, your sub-menus will not show.

  23. mrmccarrin
    Member
    Posted 1 year ago #

    Thanks for getting back to me. I have created a twenty twelve child theme. My problem seems to be that the widget is not registering. This is what I have in my functions.php:

    <?php
    
    // add any new or customised functions here
    
    if ( function_exists('register_sidebar') ){
    register_sidebar(array(
    'name' => 'my_mega_menu',
    'before_widget' => '<div id="my-mega-menu-widget">',
    'after_widget' => '</div>',
    'before_title' => '',
    'after_title' => '',
    ));
    }
    
    ?>
  24. jasonpaulweber
    Member
    Posted 1 year ago #

    It looks good to me ... if it's showing up in your wp-Admin Appearance >> Widgets ... and you see My Mega Menu then that part's okay; you've registered it. So the issue isn't in your functions.php.

    The mega menu is there ... in the lower left. But I know you want it to replace the top nav menu. The 2012 theme is quirky, and I'm trying to look for an answer on designchemical's website, but it appears to be down. If you can get to designchemical's website, try asking Lee directly via his forums.

    Wherever your menu is in your header ... the

    <?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>

    should be placed there. I'm not near a computer with Firefox on it right now or I'd Firebug it and try to see what's going on.

  25. mrmccarrin
    Member
    Posted 1 year ago #

    I wrote an email to the people at designchemical through facebook. I will try Lee. Thanks for the suggestion.

    The mega menu in the lower left is the vertical mega menu, which I installed with no problem. I installed another mega menu to replace my main navigation.

    When I added: `<?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?`

    I get the error message:

    Thank you again for your time.

  26. mrmccarrin
    Member
    Posted 1 year ago #

    This is the error message:

    Parse error: syntax error, unexpected '?' in /homepages/43/d459884280/htdocs/meganmccarrin/Megans WordPress/wp-content/themes/twentytwelve-child/header.php on line 68

  27. jasonpaulweber
    Member
    Posted 1 year ago #

    Again, 2012 is quirky, just like 2011 ... so just use:

    <?php dynamic_sidebar('my_mega_menu'); ?>

    like I suggested before and see if it still gives you the parse error.

    Lee should be able to help you out with those themes, as they're both a little different than most themes when it comes to working with plugins.

    Without seeing what's on your site directly, just keep heuristically attempting to try the above code in different parts of your header. And that doesn't mean you have to delete the native menu. You can always hide the native menu by using CSS ....

    .whateveryournativemenuiscalled {
    display:none;
    }
  28. magicmarker1955
    Member
    Posted 1 year ago #

    I put it in my header but it's not showing. I have an eleganthemes template and want it at the top because there isn't any there now.

    Can you take a look?

    http://hhs.redwebtest.com/

  29. jasonpaulweber
    Member
    Posted 1 year ago #

    And you registered the custom widget area so that it appears in Appearances >> Widgets? You see My Mega Menu there?

    And then you took the Jquery Mega Menu and dragged it into your newly-created widget area?

    And you made a custom menu, and you're using the same menu in your Mega Menu?

  30. rsl designs
    Member
    Posted 1 year ago #

    This is very helpful Jason. I'm going to go through this and see if I can change the main menu for a jquery mega menu.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic