Forked from generatepress/gist:2e17bb5378db0d3cfe12
Created
November 20, 2016 15:00
-
-
Save IkeTen/f0076068afd6430b67b590ccbcb7adf8 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
if ( ! function_exists( 'generate_back_to_top' ) ) : | |
/** | |
* Build the back to top button | |
* | |
* @since 1.3.24 | |
*/ | |
add_action( 'wp_footer','generate_back_to_top' ); | |
function generate_back_to_top() | |
{ | |
$generate_settings = wp_parse_args( | |
get_option( 'generate_settings', array() ), | |
generate_get_defaults() | |
); | |
if ( 'enable' !== $generate_settings[ 'back_to_top' ] ) | |
return; | |
$scroll_speed = apply_filters( 'generate_back_to_top_scroll_speed', 400 ); | |
$start_scroll = apply_filters( 'generate_back_to_top_start_scroll', 300 ); | |
?> | |
<a title="<?php _e( 'Scroll back to top','generatepress' ); ?>" rel="nofollow" href="#" class="generate-back-to-top" style="display:none;" data-scroll-speed="<?php echo $scroll_speed; ?>" data-start-scroll="<?php echo $start_scroll; ?>"> | |
<img src="URL TO YOUR IMAGE" alt="" /> | |
</a> | |
<?php | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment