Archived topic
Enable Back to top button on 1 page
9 replies · Started by leekapa on July 20, 2019
Hi,
Can you please help me enable the back to top button to show on one page only, which will be my homepage.
Thanks
Hi there,
Try this function:
add_filter( 'option_generate_settings', function( $options ) {
if ( ! is_front_page() ) {
$options['back_to_top'] = '';
}
return $options;
} );
Let me know :)
You Legend. Thanks heaps!
You're welcome :)
Hey Tom,
I only just noticed that this code stopped working on my front page which is still set as the same. I'm guessing that it stopped when gp updated.
Any thoughts?
Thanks,
Lee
Hmm the code should still work.
Can you link us to the page in question?
I also deactivated all plugins and still no luck. Plus I use a child theme, so the code wasn't overwritten.
Thanks
Just to make sure, the option in the customizer is turned on here?
https://docs.generatepress.com/article/back-to-top-button/
If so can you disable Autopimize for now?
Thanks :)
Sorry, I should have also checked that. It was disabled, but I don't know why. In future, that'll be the first thing I check.
Thanks again.
No problem :)