Archived topic
Make submenus visible in sidebar
10 replies · Started by Jonathan on December 7, 2020
I found several threads about this but none of the custom CSS provided worked for me.
I simply want the submenus always visible on this page, not an arrow with a dropdown: http://www.shininglightpublications.com/
Right underneath is another menu from the sidebar widget, which shows exactly what I want--the two items indented beneath the main menu item. I would just use that one, except I don't know how to custom format a particular widget, and the menu needs to be bigger and bolder than the rest of the sidebar.
Thanks for any help.
Hi,
Right underneath is another menu from the sidebar widget, which shows exactly what I want–the two items indented beneath the main menu item. I would just use that one, except I don’t know how to custom format a particular widget, and the menu needs to be bigger and bolder than the rest of the sidebar.
We can use this instead of the other one with the arrow.
We can style this particular widget with this CSS:
aside#nav_menu-4 li a {
font-size: 20px;
font-weight: bold;
line-height: 2em;
}
You can play around with the values of the properties and add more if you need to. :)
Perfect! Thanks so much! That was quick.
But I do have one more question. Now I can't seem to get rid of the primary one. Under layout - primary navigation I set location to "no navigation" and it's still there. I know I've don't this before but am drawing a blank.
But I do have one more question. Now I can’t seem to get rid of the primary one. Under layout – primary navigation I set location to “no navigation” and it’s still there. I know I’ve don’t this before but am drawing a blank.
Since it is added as a right sidebar widget, go to Appearance > Widgets and check the Right Sidebar area.
Remove it from there so it's completely removed from that part of the page. :)
That's the menu I'm keeping! The one above it is the primary menu I need to get rid of. Originally it was designated in the right sidebar, but I changed that to "no navigation" and it's still in the right sidebar!
That’s the menu I’m keeping! The one above it is the primary menu I need to get rid of. Originally it was designated in the right sidebar, but I changed that to “no navigation” and it’s still in the right sidebar!
Ah if its not there along with the other widgets then perhaps it may be added in by a plugin, a PHP snippet or an actual code added within the sidebar.php template.
The duplicate nav menu is added inside a div with class "gen-sidebar-nav". Perhaps you've used some sort of a PHP snippet or plugin that added it in?
Edit:
Its something added w/ add_action( 'generate_before_right_sidebar_content', 'generate_add_navigation_before_right_sidebar', 5 );
Which can be removed by PHP snippet remove_action( 'generate_before_right_sidebar_content', 'generate_add_navigation_before_right_sidebar', 5 );
Actually I found this CSS to work:
}.main-navigation {
display: none;
But thanks for your suggestions.
Okay, I still can't do what I need to. The CSS I generated works fine, but now the menu doesn't show in mobile either, where I want it, since the sidebar is down below the content on mobile.
Both primary and secondary navigation are set to "no navigation."
The display location for the menu itself is set ONLY to "Off Canvas Menu." Then under widgets it's selected for the right sidebar.
So why does the additional menu keep appearing in the sidebar?
It the problem is easier to solve, is there a way for the CSS above to apply only to desktop?
Thanks for persevering with me.
Try this instead:
.inside-right-sidebar > .gen-sidebar-nav{
display:none;
}
This specifically selects and hides the nav inside the right sidebar.
Note: This only hides the menu on the sidebar, it's still inside the DOM structure when the page loads. If you want to completely remove it from the DOM structure, use the remove_action PHP snippet on my previous reply.
Here's how to add PHP snippets. https://docs.generatepress.com/article/adding-php/
Bingo! Thanks so much!
Bingo! Thanks so much!
No problem. :)