Archived topic
Back to top button for one page only
3 replies · Started by George on May 25, 2019
I want to have the back to top button for one page only. I activate the back to top button from the Customizer and then add this class:
body:not(.page-id-1259 a.generate-back-to-top) {
display: none;
}
It doesn't work, though. Adding the !important rule doesn't make any difference either.
Is there a more elegant solution?
Hi there,
Give this filter a shot:
https://docs.generatepress.com/article/option_generate_settings/#options-%E2%80%98back_to_top%E2%80%99
Let me know :)
Yes Leo, perfect!
With the button disabled in the Customizer:
add_filter( 'option_generate_settings','gm_remove_back_to_top' );
function gm_remove_back_to_top ( $options ) {
if ( is_page( 1259 ) ) {
$options['back_to_top'] = 'enable';
}
return $options;
}
I knew there was a solution for that, like always!
Cheers!
Every option in the customizer should be filter-able :)