Home › Forums › Support › Enable Smooth Scroll for all anchor links This topic has 23 replies, 2 voices, and was last updated 1 year, 11 months ago by Ying. Viewing 9 posts - 16 through 24 (of 24 total) ← 1 2 Author Posts March 2, 2019 at 10:05 pm #827014 TomLead Developer Lead Developer Hi there, That’s strange. It goes away when smooth scroll is turned off? March 2, 2019 at 10:58 pm #827038 YSK If I do not use “generate_smooth_scroll_elements”, there is no problem. Also, there is no problem when using smooth-scroll class for a tag. March 3, 2019 at 9:26 am #827529 TomLead Developer Lead Developer Can you share the filter you’re using? March 3, 2019 at 3:53 pm #827805 YSK I am using a Code Snippets plugin. For the test, I only use the following filters. https://docs.generatepress.com/article/generate_smooth_scroll_elements/ add_filter( 'generate_smooth_scroll_elements', function( $elements ) { $elements[] = 'a[href*="#"]'; return $elements; } ); March 3, 2019 at 4:49 pm #827839 TomLead Developer Lead Developer Try this instead: add_filter( 'generate_smooth_scroll_elements', function( $elements ) { $elements[] = 'a[href*="#"]:not(.generate-back-to-top)'; return $elements; } ); March 3, 2019 at 4:56 pm #827841 YSK I am glad to inform you that the problem is now solved! I appreciate your help. March 3, 2019 at 6:16 pm #827878 TomLead Developer Lead Developer Awesome! Glad I could help 🙂 May 11, 2022 at 7:46 am #2216341 Annamari Hi! Has this code changed? I’d like to use it but instead of working, it adds a question mark to my URL… May 11, 2022 at 10:19 am #2216734 YingStaff Customer Support Hi Annamari, The code should still work. Can you open a new topic and link us to the page where we can see the link? Author Posts Viewing 9 posts - 16 through 24 (of 24 total) ← 1 2 You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In