🎉 Happy 4th of July! Get 15% off GP Premium with the discount code: 4THOFJULY2020

[Resolved] Enable smooth-scroll on hero button

Home Forums Support Enable smooth-scroll on hero button

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1173112
    Daniel

    Hello,
    I’m unable to get smooth-scroll to enable on a button in my hero.
    I’ve ticked the enable smooth-scroll box.
    My button looks like this:

    <p><a class="button smooth-scroll" href="#consult">Call to Action</a></p>

    And I’ve added and enabled the recommended PHP snippet:

    add_filter( 'generate_smooth_scroll_elements', function( $elements ) {
      $elements[] = 'a[href*="#"]';
      
      return $elements;
    } );

    And still I get no smooth-scroll effect with my button. Any suggestions?

    #1173113
    Leo
    Staff
    Customer Support

    Hi Daniel,

    I don’t actually see a page hero on the home page.

    Can you guide me to the page where the page hero/button can be seen?

    Thanks 🙂

    #1173114
    Daniel

    Sorry Leo – I accidentally disabled the GP premium plugin for a moment and it messed everything up. The plugin is re-activated and you should be able to see the hero now.

    #1173117
    Leo
    Staff
    Customer Support

    I can see it now.

    You shouldn’t need that PHP snippet.

    Can you try modifing this:
    <a name="consult"></a>

    to this:
    <a id="consult"></a>

    #1173119
    Daniel

    That solved the issue. Even with the snippet disabled. Thank you for your incredibly fast help!!!

    #1173121
    Leo
    Staff
    Customer Support

    Glad I could help 🙂

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