-
Raja_panda
Hello guys,
I’d like to create a menu in the footer that displays a sub-menu that opens when you move the mouse over it, just for a category like the one in this image. How can I do this?
-
You can use the secondary navigation.
1. Enable Secondary Nav module at appearance > GeneratePress.
2. Assign the menu to secondary navigation at appearance > menus.
3. Go to customize > layout > secondary navigation, set Navigation Location to
No Navigation
.4. Use this PHP code to generate a shortcode for secondary navigation:
add_shortcode( 'secondary_navigation', function() { ob_start(); if ( function_exists( 'generate_secondary_navigation_position' ) ) { generate_secondary_navigation_position(); } return ob_get_clean(); } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
5. Add the shortcode
[secondary_navigation]
to your site footer.Let me know if this helps!
-
Raja_panda
Hello Ying,
For the last step, where can i Add the shortcode [secondary_navigation] on site footer ?
I’ve tried adding [secondary_navigation]: from widget – footer but it doesn’t change anything.
-
Were you using a shortcode block to insert the shortcode?
Can I see your site?
-
Raja_panda
Hello, sorry for the delay in replying.
Yes, I used a shortcode block to insert the shortcode, but I’m not sure I did it correctly. I added a piece of code in my footer widget as shown in the image :
https://postimg.cc/4mNbf9VpHere is the website: https://passion-padel.com/
-
It looks like the secondary nav’s CSS is not loading on your site.
Can you try disabling your cache plugins to test?
Let me know 🙂
-
Raja_panda
Strange, I’ve disabled the cache plugins and it doesn’t work… 😕
-
Alvind
Hi there,
Can you provide temporary login access to your site so we can check your backend settings?
-
Raja_panda
Hello, how can I give you temporary access?
-
David
Hi there,
you can share login URLs, User names and passwords in the Private Information field below.
So you can create a new user login for us, and once you are done you can delete the login.Our servers auto delete any private information in the forums if the topic is resolved or after a period of not replies.
-
Raja_panda
Ok it’s done.
let me know when your’re find solution
-
You were adding the PHP code as HTML code:
https://app.screencast.com/fYnl2sRm76ooTChange it to PHP, then you can use the shortcode.
-
Raja_panda
Thanks. I use the shortcode but nothing happened.
Can you tell me exactly how to use the shortcode?
-
Where did you add the shortcode?
-
Raja_panda
I add the shortcode here : https://postimg.cc/3dBQyq6w
And here : https://postimg.cc/87X846TQ
I don’t know if I should add the shortcode to my footer widgets and modify my menu settings…
-
David
Hi there,
the second image, remove the shortcode from there.
And instead add the shortcode to a Footer Widget.
- You must be logged in to reply to this topic.