Can't get jquery to work.
-
Hi,
I’m trying to make a “Back to Top” jquery script in my own theme based on “_s”.
It works in jsfiddle, but I can’t get it to work on live website.I have added the following line in functions.php, and the script itself to the js folder.
function pmtau_scripts() { wp_enqueue_style( 'pmtau-style', get_stylesheet_uri() ); wp_enqueue_script( 'pmtau-navigation'...); wp_enqueue_script( 'pmtau-skip-link-focus-fix'...); wp_enqueue_script( 'pmtau-go-to-top', get_template_directory_uri() . '/js/go-to-top.js', array( 'jquery' ), '1.0.0', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'pmtau-keyboard-image-navigation...); } } add_action( 'wp_enqueue_scripts', 'pmtau_scripts' );
I can see the script being loaded in <body> section below content.
My understanding is that somehow jquery library is not loading properly, do I have to do it separately. Maybe it’s not that at all. Please help.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Can't get jquery to work.’ is closed to new replies.