[Resolved] Limit Sticky Navigation to Homepage Only

Home Forums Support [Resolved] Limit Sticky Navigation to Homepage Only

Home Forums Support Limit Sticky Navigation to Homepage Only

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #584871
    Derek

    Hello,

    How can I limit sticky navigation to my homepage only?

    Thank you!

    #584884
    Leo
    Staff
    Customer Support

    Hi there,

    This example should help: https://docs.generatepress.com/article/option_generate_menu_plus_settings/#example

    You can delete the settings you don’t need.

    Let me know if this works.

    #584892
    Derek

    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!

    #584961
    Derek

    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

    #585163
    Leo
    Staff
    Customer Support

    Looks like it’s covered up by the BB content.

    If you want the content to merge with the navigation, try this:
    https://docs.generatepress.com/article/merging-header-navigation-content/

    #585397
    Derek

    Thanks Leo thats exactly what I was trying to do but couldn’t get the words out πŸ˜›

    #585401
    Derek

    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 πŸ˜›

    Thank you!

    #585426
    Leo
    Staff
    Customer Support

    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.

    #585461
    Derek

    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!

    #585731
    Leo
    Staff
    Customer Support

    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!

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