Last active
April 14, 2020 07:06
-
-
Save generatepress/2e17bb5378db0d3cfe12 to your computer and use it in GitHub Desktop.
Replace back to top icon with an image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'generate_back_to_top_output', 'tu_custom_back_to_top_icon' ); | |
function tu_custom_back_to_top_icon() { | |
printf( | |
'<a title="%1$s" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s"> | |
<img src="URL TO YOUR IMAGE" alt="Back to top" /> | |
<span class="screen-reader-text">%5$s</span> | |
</a>', | |
esc_attr__( 'Scroll back to top','generatepress' ), | |
absint( apply_filters( 'generate_back_to_top_scroll_speed', 400 ) ), | |
absint( apply_filters( 'generate_back_to_top_start_scroll', 300 ) ), | |
esc_attr( apply_filters( 'generate_back_to_top_icon','fa-angle-up' ) ), | |
__( 'Scroll back to top','generatepress' ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment