Skip to content

Instantly share code, notes, and snippets.

@dannydickson
Last active June 7, 2021 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dannydickson/7d8e406afb9b86e11110b51dc85a8e29 to your computer and use it in GitHub Desktop.
Save dannydickson/7d8e406afb9b86e11110b51dc85a8e29 to your computer and use it in GitHub Desktop.
Floating Font Awesome Back to Top Button in WordPress
$(".to-top-btn").click( function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
//* Add To Top Button
function add_genesis_entry_totop_button () {
echo '<div class="to-top-btn"><i class="fa fa-arrow-up fa-2"></i></div>';
};
add_action('genesis_footer', 'add_genesis_entry_totop_button');
.toTopBtn {
float: none;
margin: 20px auto 0 auto;
}
@media only screen and (min-width: 550px) {
.toTopBtn {
padding: 9px;
margin: 30px auto auto auto;
width: 40px;
background: #EFEFEF;
text-align: center;
font-size: 11px;
}
.toTopBtn:hover {
cursor: pointer;
color: #19B4FF;
border: 1px solid #19B4FF;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment