JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
Save your JavaScript code out to a separate file within your plugin directory. Then use this code to load the file using the wp_enqueue_script() function. function smooth_scrolling_links() { if ( !is_admin() ) { // Don’t load if in the admin screen wp_enqueue_script(‘Smooth-Scolling-Links’, plugin_dir_url(__FILE__) .’-YOURFILENAME-.js’); } } Obviously replace the -YOURFILENAME- with the file name that … Read more