- This topic has 7 replies, 3 voices, and was last updated 8 years, 2 months ago by ian.
-
AuthorPosts
-
February 4, 2016 at 6:24 am #170348ian
the back to top button in my opinion
turns on too late when scrolling down and turns off too early when scrolling up
it is shown next to “Smooth Page Scroll to Top” plugin
Minor point but thought I would point it out
Also is it possible to change the icon used for this ?
Ian
- This topic was modified 8 years, 2 months ago by ian.
- This topic was modified 8 years, 2 months ago by ian.
February 4, 2016 at 11:28 am #170433TonyI agree that the plugin comes on a fraction earlier then the built-in one but maybe too soon, before you need to go ‘top’?
Overall it seems to work ok on Chrome – for me anyway.February 4, 2016 at 5:11 pm #170502TomLead DeveloperLead DeveloperI included some filters in this feature so these values can be adjusted: https://generatepress.com/knowledgebase/filter-list/
generate_back_to_top_scroll_speed
Default: 400generate_back_to_top_start_scroll
Default: 300For example:
add_filter( 'generate_back_to_top_start_scroll', 'generate_back_to_top_start_scroll' ); function generate_back_to_top_start_scroll() { return 100; }
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Let me know if you need more info ๐
February 5, 2016 at 5:41 am #170618ianthanks very much
never tried adding my own php before but it all went very well
works perfectly nowthanks for your help/advice
you didn’t say if it is possible
to change the icon used for this ?Ian
February 5, 2016 at 5:55 am #170627ianJust found this flter
generate_back_to_top_iconso forget above question
Ian
February 5, 2016 at 6:12 am #170633iancan’t get change back_to_top_icon filter to work
this is the code I am trying
generate_back_to_top_start_scroll works
generate_back_to_top_icon doesn’tadd_filter( ‘generate_back_to_top_start_scroll’, ‘generate_back_to_top_start_scroll’, ‘generate_back_to_top_icon’);
function generate_back_to_top_start_scroll()
{
/* make back to top appear sooner when down, later when up */
return 100;
}function generate_back_to_top_icon()
{
/* change icon */
return ‘fa-hand-o-up’;
}any idea what I am doing wrong
Ian
February 5, 2016 at 8:24 am #170660TomLead DeveloperLead DeveloperHi Ian,
You’re forgetting the add_filter call:
add_filter( 'generate_back_to_top_icon','generate_back_to_top_icon' ); function generate_back_to_top_icon() { return 'fa-hand-o-up'; }
- This reply was modified 8 years, 2 months ago by Tom.
February 5, 2016 at 9:01 am #170682ianHi Tom
Thanks for that it works ๐
Ian
- This reply was modified 8 years, 2 months ago by Tom.
- This reply was modified 8 years, 2 months ago by Tom.
-
AuthorPosts
- You must be logged in to reply to this topic.