Skip to content

Snippet: Alter Scroll to Top Speed

Important: You can now control your local scroll speed via the Customizer under the General tab.

You can use the following code in your child theme's functions.php file to alter the back to top scroll speed. Simply change the 1000 value to your value of choice (speed in milliseconds).

add_filter( 'wpex_localize_array', function( $settings ) {
	$settings[ 'scrollTopSpeed' ] = 1000;
	return $settings;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top