[Support request] Dropdown menus

Home Forums Support [Support request] Dropdown menus

Home Forums Support Dropdown menus

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
  • #2247459


    I want to add various dropdown menus within the content area. I tried using third party accordion on a grid layout (3 in a row) but does not suit me as everytime one accordion opens the content below them is pushed down.

    I need to achieve the same effect the primary menu has when on opening the submenu hides any other content over that page space but does not pish the page xontent further down.

    Is it possible to create multiple different dropdown menus & add them via a hook or shortcode anywhere on generatepress?

    Customer Support

    Hi there,

    This is not something that the theme can do.

    I would recommend trying WP’s Navigation block.



    thank you for your reply.

    I have tried the nabigation block, it does not display the menu properly.

    Is there not a way to create multiple menus and display them anywhere on the theme?

    Customer Support

    Hi there,

    Is there not a way to create multiple menus and display them anywhere on the theme?

    No, the Theme provides 3 x Navigation elements, each of which can display a single Menu and can be displayed within the theme. They are not built for displaying inside your content.


    I have tried this solution from another topic with some success:


    That would allow me to display a menu with a shortcode anywhere on the site where it can run shortcodes.

    The issue is that the menu just appears as a list – is it possible to make it expand on click?

    Customer Support

    It would require Custom Development which is out of the scope of this forum.


    I don’t understand why a PHP snippet solution with CSS styling is provided to another GP user (see link below) but for my case it is a matter for custom development. It is the same question.


    My question is in line with the GeneratePress Premium support scope (link below):


    The ‘What support includes’ link refers support for PHP/HTML issues on top of CSS support for those who have purchased the premium license.

    The php snippet I used should work on hover with the right modifications and/or CSS – but I have not the technical ability to identify this.

    I am not requesting for complex php or any javascript custom code nor think this is what my issue requires but a review why this php snippet (provided to another user on this forum) does not work in my case.

    Lead Developer
    Lead Developer

    Hi there,

    When it comes to providing custom coding solutions, it really depends on the complexity behind it and whether or not our team has something they can easily share. It’s possible that the solution you linked to was something Elvin had pre-built or had close by. We simply can’t be spending 30+ minutes building custom solutions in the forum here – doing so would require us to dramatically increase the cost of the product.

    As for this issue, I don’t see that code on your page. What exactly about it isn’t working, and is there somewhere I can see it not working?



    Hi there,

    I do not have technical expertise hence I purchased your product to facilitate aspects of website building.

    I do not know when a CSS or PHP or HTML solution provided by support is custom code or just easily sourced and shared. I do not know where that threshold is. I have another day job and during my free time I try to make the best of the resources I have available to build my site always in line with their T&Cs.

    I appreciate the product and this is shown by my purchase of a premium license and its renewal.

    I thought I was abiding by the GP rulebook which states that premium license is provided with support including CSS, PHP , HTML. I had not appreciated that php for my question was a more difficult thing to achieve.

    When support is unable to assist I am happy to have a brief explanation as to why the issue is more complex and even what custom code development is and where to source it – that would be educational for me or anyone else reading later on (I gather these forum pages are indexed).

    I have removed this php code as I could not fix it despite trying some solutions found elsewhere.

    As I understand now php codes for dropdown menus are difficult/time consuming so your team cannot provide solutions or direction.

    I have hence searched and found this resource which I will try: https://blog.hubspot.com/website/html-dropdown



    I have tried using the php code again.

    The menu is displayed but the submenu is already open.

    Is there a CSS or php modification to achieve having the submenu closed and open on click?

    Customer Support

    Hello there,

    What PHP did you use? Is it the one you linked? It seems the menu you added isn’t working as expected. There should be a script toggling the menu open and close. Your menu isn’t doing that. Were you able to add the script mentioned at the bottom of the article?: https://blog.hubspot.com/website/html-dropdown#:~:text=and%20the%20result%3A-,Multiselect%20Dropdown,-In%20the%20examples

    Moreover, may I know why a navigation Block wouldn’t work for you? Perhaps we can alter that with CSS if it’s the design that isn’t working out for you.

    Kindly let us know.

    Lastly, with regards to customization in terms of PHP, CSS and HTML, our support includes providing basic examples and getting our customers headed in the right direction: https://generatepress.com/what-support-includes/

    We try our best though to go out of our way and provide extensive support when we can, depending on the issue at hand, the difficulty and the time it would take to finish.

    Hope you understand!


    Hello thank you for your reply:

    I used the following:

    add_shortcode(‘portable_menu’, function($atts){
    $atts = shortcode_atts( array(
    ‘menu_name’ => ”
    ), $atts, ‘portable_menu’ );
    ‘menu’ => $atts[‘menu_name’],
    ‘container’ => ‘div’,
    ‘container_class’ => ‘portable-nav’,
    ‘menu_class’ => ”,
    ‘fallback_cb’ => ‘generate_menu_fallback’,
    ‘items_wrap’ => ‘<ul class=”portable-nav-menu ‘ . join( ‘ ‘, generate_get_element_classes( ‘menu’ ) ) . ‘”>%3$s‘,
    return ob_get_clean();

    The menu is produced but the submenu is opened.
    If this is difficult to achieve with CSS I can just let it go , I understand it is a more complex question

    Customer Support

    Yes, you would need Javascript if you want this snippet to “show and hide” sub menu items on click.

    The WP Navigation Block already has this “embedded” to it, so no need for custom code: https://share.getcloudapp.com/E0uybwq6

    You’ll only need CSS which we can try to help you with.

    Hope this clarifies!


    Thank you for clarifying this.

    I had tried the navigation block before, it works but the issue is that if you amend the menu it does bot update. And tbh I have tried removing a menu drom the block in order to re-introduce the amended menu & embarassingly could not manage to get round how to do this.

    But will try again later today & see if I can get my head round how to change amended menus on the navigation block

    Customer Support

    I see.

    Here’s the documentation for the WP Navigation Block: https://wordpress.org/support/article/navigation-block/

    If you get around it and decide to use it, we’ll be here if you’ll need guidance styling it.

    Feel free to reach out anytime!

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