-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
53 lines (47 loc) · 1.14 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* WebberZone 2020 functions and definitions
*
* @package WZ_Theme_2020
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'neve_child_load_css' ) ) :
/**
* Load CSS file.
*/
function neve_child_load_css() {
wp_enqueue_style( 'neve-child-style', trailingslashit( get_stylesheet_directory_uri() ) . 'style.min.css', array( 'neve-style' ), NEVE_VERSION );
}
endif;
add_action( 'wp_enqueue_scripts', 'neve_child_load_css', 20 );
/**
* Add javascript to header.
*
* @return void
*/
function neve_child_load_js() {
?>
<a href="#" class="scrollToTop"><i class="fas fa-arrow-circle-up fa-2x"></i></a>
<script>
jQuery(document).ready(function( $ ){
//Check to see if the window is top if not then display button
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollToTop').fadeIn();
} else {
$('.scrollToTop').fadeOut();
}
});
//Click event to scroll to top
$('.scrollToTop').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
});
</script>
<?php
}
add_action( 'wp_footer', 'neve_child_load_js', 5000 );