Site logo

Archived topic

Submenu constantly toggled (open)

5 replies · Started by Gabriela on January 2, 2021

Viewing posts 1–6 of 6

Hi!

I need to display the submenu constantly toggled (open) when I am viewing the Portfolio category posts, both in desktop view and in tablet and mobile view (Menu Off Canvas).

https://danielaschneider.com.br/portfolio/elevado/

Hi Gabriela,

Give this css a try:

body.single-post .widget-area .main-navigation ul ul {
    left: auto;
    display: block !important;
    width: 100%;
    transition-delay: 150ms;
}

body.single-post .main-navigation ul.sub-menu {
    opacity: 1;
    visibility: visible;
    overflow: visible;
    position: relative;
    pointer-events: auto;
    height: auto;
    padding-left: 0.75em;
    padding-bottom: 2em;
}

@media (max-width: 768px) {
    body.single-post #generate-slideout-menu.main-navigation ul ul {
        display: block;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know :)

Hi Ying,
Thanks for the reply!
Yes it worked fine, but I need all the posts in Portfolio category to have the submenu toggled displayed, not just one post.
In fact, it would be nicer if the Portfolio item in menu had its submenu automatically populated from the Portfolio category posts. But as I don’t know how to do it, I added each post manually to the submenu.
Maybe if I can make the submenu from category, the CSS should work like this:

body.category-portfolio .widget-area .main-navigation ul ul {
left: auto;
display: block !important;
width: 100%;
transition-delay: 150ms;
}

body.category-portfolio .main-navigation ul.sub-menu {
opacity: 1;
visibility: visible;
overflow: visible;
position: relative;
pointer-events: auto;
height: auto;
padding-left: 0.75em;
padding-bottom: 2em;
}

@media (max-width: 768px) {
.category-portfolio #generate-slideout-menu.main-navigation ul ul {
display: block;
}
}

But, as long as I added all the submenu items manually, it doesn’t work.

Hi Ying!
Yes, it worked fine!!

Thank you!

Great!

Glad to help :)

This archived topic is closed to new replies.