Поддержка Проблемы и решения Не открывается файл стилей

Просмотр 11 ответов — с 31 по 41 (всего 41)
  • Уверен на 1000% у меня один сайт

    То, что Вы уверены не отменяет того, что Вы делаете не там.

    Это не вопрос конкретно ВП. Это общий вопрос.
    Вот создайте в корне (и/или рядом) с файлом стилей текстовый файл (никак не связанный с ВП) и откройте его браузером.

    Ну вот файл создал открывается http://ogranicheniy-no.ru/wp-content/themes/My_themy/test.txt

    еще раз приведите текущий код, которым у вас подрубаются стили.

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
        <title>Bootstrap 101 Template</title>
    <link rel="stylesheet" href="<?bloginfo( 'template_directory' );?>" type="text/css" />
    <link rel="stylesheet" href="<?bloginfo( 'template_directory' );?>/css/style.css" type="text/css" />
    
        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    <?php
    wp_head();
    ?>
      </head>
      <body>
        <div class="container">
        <div class="row">
          <header class="col-md-12">
            <!-- <img src="logo.jpg" height="150" width="800"> -->
                  <div class="top-menu">
                    <ul class="nav nav-tabs">
                  <li><a href="#">Link 1</a></li>
                      <li><a href="#">Link 2</a></li>
              </ul>
            <form>
      <input type="search" placeholder="Поиск...">
      <button type="button" class="btn-form"><span class="glyphicon glyphicon-search"></span></button></form>
          </header>

    footer.php

    <footer class="col-md-12">
            <hr>
        </footer>
      </div></div>
        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="js/bootstrap.min.js"></script>
    <?php wp_footer();?>
      </body>
    </html>

    functions.php

    function wptuts_styles_with_the_lot()
    {
        // Register the style like this for a plugin:
        wp_enqueue_style( 'my-custom-style', get_template_directory_uri() . '/css/style.css' );
        // or
        wp_enqueue_style( 'custom-style' );
    }
    add_action( 'wp_enqueue_scripts', 'wptuts_styles_with_the_lot' );

    вот так пробуйте:

    function wptuts_styles_with_the_lot()
    {
    wp_register_style('my-custom-style', get_template_directory_uri() . '/css/style.css' );
    wp_enqueue_style( 'my-custom-style' );
    }
    add_action( 'wp_enqueue_scripts', 'wptuts_styles_with_the_lot' );

    Ни каких изменений, тоже самое

    хотя я реально не понимаю, откуда у вас на сайте код:

    <!-- Bootstrap -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="css/style.css">
        <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css">
        <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">

    в header.php у вас вообще нет строчки:

    <!-- Bootstrap -->

    где оно подрубается то?

    поиском по файлам темы найдите:

    <!-- Bootstrap -->

    сдается мне, что у вас там отдельная функция для подключения этих стилей и именно туда надо добавить get_template_directory_uri()

    Так вот и я про тоже, в исходном коде типа стили нормально подключены,бред какой-то))) Попробую поискать

    Всем спасибо проблема решена с помощью http://underscores

    Отдельное спасибо denisco

Просмотр 11 ответов — с 31 по 41 (всего 41)
  • Тема «Не открывается файл стилей» закрыта для новых ответов.