define('S_THEME_ROOT', get_template_directory_uri()); define('S_CSS_DIR', S_THEME_ROOT . '/assets/css'); define('S_JS_DIR', S_THEME_ROOT . '/assets/js'); define('S_IMG_DIR', S_THEME_ROOT . '/assets/img'); add_action( 'wp_enqueue_scripts', function() { wp_enqueue_style( 'page', S_CSS_DIR . '/page.css'); wp_enqueue_style( 'main', S_CSS_DIR . '/style.css'); wp_deregister_script('jquery'); wp_enqueue_script('page', S_JS_DIR . '/page.min.js'); 

The link shows the connection, but in fact the script does not work. With styles everything is OK

  • What kind of links? What is in the console? No mistakes? What is the script in the page code (Ctrl + U)? - KAGG Design pm
  • In the links ie There is a connection in the page code and there are no errors, but the script does not work. And just in the layout works. - Lykin Cyril
  • Script show - KAGG Design
  • Well, immediately the question - and if you put the breakpoint on the first line of the script? - KAGG Design 3:32 pm
  • @KAGGDesign Here is the script: yadi.sk/d/l9OV9pn1IW-6Pw - Lykin Kirill

1 answer 1

Connected through

 if ( !is_admin() ) { function register_my_js() { wp_enqueue_script( 'my-script', S_JS_DIR .'/page.min.js', array( 'jquery' ), '1.0', true ); } add_action('init', 'register_my_js'); }