Theme path of WordPress inside javascript file

You don’t seem to have a trigger for your JS. You can test that the script is actually running by adding a quick console, such as console.log(‘xyz.js is running’); Once you’re sure your JS is running, you can add a trigger. If you’re already loading jQuery, it has an easy .ready() function to use, but … Read more

How do I cycle a JS function in WordPress? [closed]

Rather than trying to include jquery with your javascript, you should use wordpress to define jQuery as a dependency to your custom script. function custom_js_script_enqueue(){ wp_enqueue_script( ‘mycustomjs’, CHILD_THEME_URI . ‘/assets/js/my-custom-js.js’, array(‘jquery’), ‘1.0.0’ ); } add_action(‘wp_enqueue_scripts’, ‘custom_js_script_enqueue’); you can read about all of the libraries available in wordpress here. Your script should not include the jquery … Read more