one

2

In the functions.php file I connected all the files:

function theme_name_scripts() { wp_enqueue_style( 'style', get_stylesheet_uri()); wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/libs/Bootstrap-3.3.7/css/bootstrap.css'); wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', '','null',true); wp_enqueue_script( 'bootstrapjs', get_template_directory_uri() . '/libs/Bootstrap-3.3.7/js/bootstrap.min.js', '','null',true); wp_enqueue_script( 'masonry', get_template_directory_uri() . '/js/masonry.min.js', '','null',true); wp_enqueue_script( 'common', get_template_directory_uri() . '/js/common.js', '','null',true); } add_action( 'wp_enqueue_scripts', 'theme_name_scripts' ); 

Files are connected in the header, but do not work! Help me please!

  • That is, the corresponding link and script tags are inserted on the page, but the styles are connected while the scripts do not work? Got errors in the javascript console? - tutankhamun
  • @tutankhamun, yes that's right. There are no errors. I assume that the content part loads faster than scripts and therefore they do not work. - goodalien

1 answer 1

  1. There is no wp_enqueue_style action in the wp_enqueue_style .

  2. It is necessary to throw everything out of the code with regards to styles and jquery, and to include the wp_head and wp_footer functions in the samopisny theme .

In any case, with such a problem, it is worth checking on topics from the set of VP.

  • It works without 1 point) - goodalien