The generate_smooth_scroll_elements
allow you to initiate smooth scroll on other element classes instead of just ones with the smooth-scroll
class.
Use the following PHP snippet to apply smooth scroll to all hash links:
add_filter( 'generate_smooth_scroll_elements', function( $elements ) {
$elements[] = 'a:not([data-gpmodal-trigger="gp-search"])[href*="#"]';
return $elements;
} );