• For some reason my jquery doesn’t work and I’m trying to figure out why.

    function tutorial3_script_enqueue(){
    
    		//css
    		wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/tutorial3.css', array(), '1.0.0', 'all');					//Getting the style to show up.
    
    		//js
    		wp_enqueue_script('jquery');
    		wp_enqueue_script('customjs', get_template_directory_uri() . '/js/tutorial3.js', array(), '1.0.0', true);
    	}
    
    add_action('wp_enqueue_scripts', 'tutorial3_script_enqueue');																		//Call the above function over here via a add_action

    I then call the jquery by adding a <?php wp_footer(); ?> in my footer.

    It’s working fine for the css, but no matter what I try to edit in jquery, it won’t show up on the site.

Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there!

    Does your browser’s console show any errors?

    Ps, not sure if you are aware but you can list jquery as a dependency for your script; that is what the array() is for. Using array( 'jquery' ) will make jQuery load without having to use

    wp_enqueue_script('jquery');
Viewing 1 replies (of 1 total)
  • The topic ‘jquery not working.’ is closed to new replies.