2016-06-12 5 views
0

Я не могу понять, что случилось с моим кодом. Это он до сих пор:Что-то не так с enqueueing bootstrap в functions.php (Wordpress)

function reg_scripts() { 
wp_enqueue_style('bootstrapstylemin', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css'); 
wp_enqueue_style('bootstrapstyleresmin', get_template_directory_uri() . '/bootstrap/css/bootstrap-responsive.min.css');} 

add_action('wp_enqueue_scripts', 'reg_scripts'); 

function wpbootstrap_scripts_with_jquery(){ 

wp_enqueue_script('custom-scriptes', get_stylesheet_directory_uri() . '/bootstrap/js/bootstrap.js', array('bootstrap-jquery')); 

add_action('wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery'); 

I am sorry, there is a screenshot of the console

После того как я увидел эти ошибки, я удалил CDN, но до сих пор не работает.

+0

Вы не указали, что неправильно, так что никто не может сделать для вас ничего. Вы проверили консоль на наличие ошибок? то есть. 404 по файлам? # – David

ответ

0

попробуйте это;

function reg_scripts() { 
wp_enqueue_style('bootstrapstylemin', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css', array(), '3.4.6'); 
wp_enqueue_style('bootstrapstyleresmin', get_template_directory_uri() . '/bootstrap/css/bootstrap-responsive.min.css', array(), '1.0.0'); 
} 

add_action('wp_enqueue_scripts', 'reg_scripts'); 

function wpbootstrap_scripts_with_jquery(){ 

wp_enqueue_script('custom-scriptes', get_stylesheet_directory_uri() . '/bootstrap/js/bootstrap.js', array('bootstrap-jquery'), '3.4.6', false); 

add_action('wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery'); 
+0

Я пробовал, но все равно не работал :( –

 Смежные вопросы

  • Нет связанных вопросов^_^