- This topic has 32 replies, 3 voices, and was last updated 5 years, 9 months ago by Richard.
-
AuthorPosts
-
July 19, 2018 at 1:16 am #627234Richard
Hey guys,
searched for this in the forum and couldn’t quite find it.
For this site, https://eatthat.de/ , the client would like to have the back to top button to be:
– fixed in place (no starting viewpoint?)
– centered on all screen sizes
– chevron-double-up as icon (font awesome)Any way doable?
Thanks for your help!
Best,
RichardJuly 19, 2018 at 2:20 am #627266DavidStaffCustomer SupportHi Richard,
you can use this filter to set the starting position:
https://docs.generatepress.com/article/generate_back_to_top_start_scroll/
Horizontally centred:
.generate-back-to-top, .generate-back-to-top:visited { right: calc(50% - 15px); }
Change icon:
.generate-back-to-top:before { content: "fa unicode in here"; font-family: FontAwesome; }
Add the fa unicode and set the font family.
July 19, 2018 at 3:18 am #627289RichardHi David,
last two worked, thank you!
In which location would I put the hook in GP hooks?
And what goes where in here:
generate_back_to_top_start_scrolladd_filter( ‘filter_name’, ‘example_function_name’ );
function example_function_name()
{
return ‘Your new value’;
}Any recommendations for the value to make it stay at the bottom?
Thank you!
Best,
RichardJuly 19, 2018 at 3:45 am #627293DavidStaffCustomer SupportYou would need to add that function to your child theme functions.php or use Code Snippets.
I believe 0 should keep it displayed πJuly 19, 2018 at 3:50 am #627295RichardIs filter name and function name the same?
Like this:
add_filter( ‘generate_back_to_top_start_scroll’, ‘generate_back_to_top_start_scroll’ );
function generate_back_to_top_start_scroll()
{
return ‘0’;
}July 19, 2018 at 3:52 am #627297DavidStaffCustomer SupportNo, its the one thing it shouldn’t be. Name the function whatever you want – something meaningful, don’t use hyphens just underscores.
July 19, 2018 at 4:12 am #627311RichardSo I have this:
add_filter( ‘generate_back_to_top_start_scroll’, ‘back_to_top_fixed’);
function back_to_top_fixed()
{
return ‘0’;
}But isn’t doing anything in the front-end. π
July 19, 2018 at 4:14 am #627312Richard‘O’ has it right from the top.
July 19, 2018 at 4:18 am #627313Richard3000 does the trick on desktop, but this isn’t responsive, of course – it just slips off the page.
July 19, 2018 at 4:28 am #627321DavidStaffCustomer SupportOK, scrub that then, lets use some CSS:
.generate-back-to-top { visibility: visible !important; opacity: 1 !important; }
July 19, 2018 at 4:40 am #627339RichardHey Dave,
so I deactivated the snipped and added the CSS.
Now it’s back at the top. It just needs to stay put in the footer. π
Thanks!
RichardJuly 19, 2018 at 4:53 am #627342DavidStaffCustomer SupportTry clearing caches – it’s slap bang center at the bottom of the screen for me π
July 19, 2018 at 5:02 am #627349RichardAnd stayed put at the bottom?
July 19, 2018 at 5:03 am #627350RichardCleared cache and it starts right below the slider.
July 19, 2018 at 5:11 am #627356DavidStaffCustomer SupportAah, sorry i think i misinterpreted this…. you don’t want the back to top to display at all other then when you reach the actual footer?
-
AuthorPosts
- You must be logged in to reply to this topic.