Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1395395

    Is it possible to place a pull doen menu similar to main menu as widget in the content part e.g. below headline?

    I have created a separate menu in menu section, then created an custom widget and placed it in the content part of the page.
    Menu is visible but only full opened, each menu point below other.

    I would like to have menu that opens when the mouse move over or opens on mouse click … to save space

    aaaaaa

    • This topic was modified 1 year, 7 months ago by xeovision.
    #1395741

    Hey Sebastian,
    Thanks for your question, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

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

    This will let you show a menu in your page content as a shortcode, if your menu name is test then the shortcode to show it would be:
    [menu name="test"]
    Add the shortcode to a code block element:
    Then add this css:

    .entry-content-wrapper ul.menu-shortcode,
    .entry-content-wrapper .menu-shortcode li {
    	list-style: none outside;
    }
    .menu-shortcode .sub-menu {
    	height:0;
        opacity: 0;
        visibility: hidden;
    	transition: all 0.5s ease 0s;
    }
    .menu-shortcode .menu-item-has-children:hover > .sub-menu {
    	height: 100%;
        opacity: 1;
        visibility: visible;
       transition: all 0.5s ease 0s;
    }
    

    I added transition to the css to ease in and out the sub-menus so it was not so fast.
    Click the image to see the gif play
    Enfold_Support_216.gif
    https://img.savvyify.com/images/2023/01/28/Enfold_Support_216.gif

    Best regards,
    Mike

    #1395811

    Cool, thats a pritty cool solution. Thanks.
    Works as expected.

    • This reply was modified 1 year, 7 months ago by xeovision.
    #1395819

    Hi,
    You would need to use javascript to toggle the menu on click and it would be complicated to know if the click was to open a sub-menu item or go to the sub-menu url.
    You should look for a menu plugin that will create this kind of menu and give you a shortcode to add to your pages.
    I’m not sure what you mean by a protected area, you would need to explain in more detail.

    Best regards,
    Mike

    #1397624

    Password proected area, the menu should be displayed after added the password for the page.
    Issue solved now, ticket can be closed

    #1397635

    Hi,
    Glad to hear that you have this sorted out, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Drop down menu in conent section’ is closed to new replies.