Site logo

Archived topic

Limit Sticky Navigation to Homepage Only

9 replies · Started by Derek on May 25, 2018

Viewing posts 1–10 of 10

Hello,

How can I limit sticky navigation to my homepage only?

Thank you!

Solution: Turn off sticky navigation in customizer, then insert the following php snippet:

add_filter( 'option_generate_menu_plus_settings','lh_custom_homepage_menu_plus_settings' );
function lh_custom_homepage_menu_plus_settings( $options ) {
    if ( is_front_page() ) {
        $options['sticky_menu'] = 'on';
    }
    
    return $options;
}

Thanks!

Sorry to re-open this but now I'm having an issue:

The stick navigation menu is not showing on my home page until I scroll. I saw this post here: https://generatepress.com/forums/topic/sticky-nav-not-showing/ and I was wondering if maybe this behaviour was implemented as default?

How can I fix this?

Thanks

Thanks Leo thats exactly what I was trying to do but couldn't get the words out :P

Thanks. It works, almost. The menu does show up, but the background still doesn't until you scroll.

And, although its almost working now on my home page, the other pages are completely messed up for some reason. See the blog page for example :P

Thank you!

What version of GP premium are you using?

Looks like you have transparent navigation set in the page header. Can't quite tell as you have caching plugin turned on.

I'm using the latest version. I was just following the instructions from that doc, it had the transparency set that way. I set it to match the customizer and that part is working now :)

Moving onto the other issue: See how the menu is floating way to low on every page besides the home page? I'll turn the cache off completely until this is solved.

Thanks again!

Any chance you can open a separate topic for this question?

The sticky navigation to home page only question is solved so I'll mark this resolved.

Helps us track the issue as I always read the title and scroll to the topic to see the issue.

Thanks!

This archived topic is closed to new replies.