0

Не получается подключить стили. В файле index.php перед закрывающим тегом </head> прописал <?php wp_head(); ?>, перед </body> прописал <?php wp_footer(); ?> . В файле function.php код. Пути все правильные, проверял. Не могу найти ошибку или чего-то не так сделал. Помогите разобраться.

<?php

function my_style() {
	wp_register_style ('bootstrap', get_template_directory_uri() . 'libs/bootstrap/css/bootstrap-grid.min.css');
	wp_enqueue_style('bootstrap');

	wp_register_style ('animate', get_template_directory_uri() . 'libs/animate/animate.css');
	wp_enqueue_style('animate');

	wp_register_style ('fontawesome', get_template_directory_uri() . 'libs/fontawesome/font-awesome.min.css');
	wp_enqueue_style('fontawesome');

	wp_register_style ('owlcarousel', get_template_directory_uri() . 'libs/owlcarousel/css/owl.carousel.min.css');
	wp_enqueue_style('owlcarousel');

	wp_register_style ('style', get_template_directory_uri() . 'style.css');
	wp_enqueue_style('style');
}
add_action( 'wp_enqueue_scripts', 'my_style' );

function load_script() {
	wp_deregister_script('jquery');

	wp_register_script('jquery', get_template_directory_uri() . 'libs/jquery/jquery-1.11.2.min.js');
	wp_enqueue_script('jquery');

	wp_register_script('waypoints', get_template_directory_uri() . 'libs/waypoints/waypoints.min.js');
	wp_enqueue_script('waypoints');

	wp_register_script('owlcarousel', get_template_directory_uri() . 'libs/owlcarousel/js/owl.carousel.min.js');
	wp_enqueue_script('owlcarousel');

	wp_register_script('animate', get_template_directory_uri() . 'libs/animate/animate-css.js');
	wp_enqueue_script('animate');

	wp_register_script('common', get_template_directory_uri() . 'libs/js/common.js');
	wp_enqueue_script('common');
}
add_action( 'wp_enqueue_scripts', 'load_script' );

1 ответ 1

0

Слеши поставьте. /libs/bootstrap/css/bootstrap-grid.min.css ну и т.д.

2
  • Заработало))) спасибо))) теперь со / буду внимательно))
    – Sergey39
    8 фев 2017 в 21:19
  • @Sergey39 Отметьте вопрос как решённый.
    – n.osennij
    8 фев 2017 в 21:23

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.