• Resolved callaloo

    (@callaloo)


    Hello Tom. What does this mean?

    This option is also integrated with the sticky navigation, so the top of your anchor point isn’t hidden.

    https://docs.generatepress.com/article/smooth-scroll/

    Also, I use this js code to make the theme’s default menu to hide and show on scroll (I changed the menu position to sticky because setting it to ‘fixed’ pulls content up and behind the menu). When logged in, the menu shows behind WP admin bar (because the bar is fixed). Is there a way to make it show below the admin bar? How do you achieve this with GP premium when logged in? The CSS I borrowed there is just the transition: top 0.3s;

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there,

    if you’re using the GP Sticky Navigation and Smooth Scroll Option when an anchor link is scrolled to, it offsets the position by the height of the navigation automatically. This stops a scrolled to anchor from being covered by the GP Sticky Nav. This also considers the Admin Bar being present on the page.

    For your own custom CSS – If a user is logged in then WP adds this class to the body: admin-bar

    Based on the W3Schools example an additional CSS rule like so would work:

    .admin-bar #navbar {
        top: 80px;
    }
    • This reply was modified 5 years, 2 months ago by David.
    Thread Starter callaloo

    (@callaloo)

    1 Okay. Understood!
    2. I forgot to specify that the menu is hidden when scrolling (up). When I scroll back up, the menu appears hidden behind the admin bar. The code didn’t work but based n the same insight, I tried these two ways:

      a. Setting the z-index value of #site-navigation to 100001 (menu shows above admin bar on down-scroll)
      b. Setting #Wpadminbar position to absolute (so it only shows when someone scrolls back to the very top).

    I have a sight that requires people to log, which of these two methods do you recommend? If you have a better way, I am open to hearing it. The WP admin bar has specific menus based on user roles.

    Thread Starter callaloo

    (@callaloo)

    Both options seem not to be good. First one obscures dropdown text on the wp-admin bar and the second one makes the admin bar to appear displaced on the back end.
    Edit: the second option seems to work using ! is_admin (). But the bar only shows when the user scrolls to the very top. I see GP premium assigns a new class to Sticky navigation?

    Theme Author Tom

    (@edge22)

    Hi there,

    Is there any way you can link us to your site so we can see the issue?

    The GPP sticky navigation adds this class: navigation-stick

    That being said, we aren’t allowed to support GPP features in these forums – it’s a www.ads-software.com rule. Feel free to use our premium forums: https://generatepress.com/support

    Thread Starter callaloo

    (@callaloo)

    I am using the free GP theme. I mentioned GPP after looking at styles of some sites and demos using GP. I have found a solution by targeting that code twice, for logged in and logged out users. I retain it as is for logged in users (incorporating GP menu height of -60px) and for the logged out users, I add 32px to the top option to cater to the admin bar.

    Theme Author Tom

    (@edge22)

    Awesome, glad you found a solution! ??

    Thread Starter callaloo

    (@callaloo)

    Correction: I retain it as is for logged out users (incorporating GP menu height of -60px) and for the logged in users, I add 32px to the top option to cater to the admin bar.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Smooth scroll’ is closed to new replies.