Не подключаются стили в шаблон
Проблема такая, уже несколько месяцев пытаюсь подключить сначало стили в Google Chrome(до этого подключала в браузере).Ни в какую ни хотят подключаться. Я уже и в настройки лезла и на ошибки тчательно проверяла, все бесполезно.Даже другие стили в очередь ставила, WordPress будто бы и не пытается их подключить. У меня стоит Windows 10 32bit WordPress 5.5.3 . Подключаю все через OpenServer как и положенно.
Код в Header.php
<!DOCTYPE HTML> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo('charset');?>"> <meta name ="viewport" content = "width=device-width, initial-scale=1.0"> <link rel="profile" href="https://gmpg.org/xfn/11"/> <link rel='dns-prefetch' href='//fonts.googleapis.com' /> <?php wp_head(); ?> </head> <body <?php body_class(); ?> > <header class = "header"> <div id = "block1"> <div class = "header_ss"> link for the site to the organization </div> <div class="logo_picture"> <img></img> </div> <div class = "header_panel"> <footer> <p> <a1 href="">Главная</a1> <a2 href="">О нас</a2> <a3 href="">Регистрация</a3> <a4 href="">Вход</a4> </p> </footer> </div> <div class = "logo"> We help people </div> </div> <div class = "header_logo"> <figure></figure> </div> </header>
Код в Function.php
<?php /*Добавляем block*/ function myblockload(){ wp_register_style('my-style', get_template_directory_url() . '/assets/css/style.css'); wp_enqueue_style('my-style'); } add_action( 'wp_enqueue_block','myblockload' );
Код style.css
/* Theme Name: shablonforwordpress1 */ *{ margin: 0; padding: 0; } body{ background: url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой3.png); background-size: cover; background-repeat:no-repeat; } .header_logo img{ background:url(C:\Users\TheNay\макетдляWordPress\assets\images\1.jpg); background-repeat: no-repeat; background-position: center; margin-top: 140px; height: 760px; width:100%; background-size: cover; padding: 0; margin: 0; } .logo{ font-size:70px; color: aliceblue; position: absolute; margin-left: 30px; top: 25px; } .logo_picture img{ background:url(C:\Users\TheNay\макетдляWordPress\assets\images\health-304919_960_720.png); background-size: cover; background-position: center center; height: 120px; width: 120px; margin-left: 540px; top: 8px; position: absolute; } .header_panel p { word-spacing: 10px; font-size:25px; color:white; position: absolute; margin-right:30px; top: 75px; left:760px; } .header_ss { font-size: 30px; margin-left: 760px; top: 30px; position: absolute; } .header_ss2{ font-size:40px; position: absolute; color: white; top: 925px; left: 340px; } .logo_picture2 img{ background-image: url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 7.png); background-size: cover; position: absolute; height: 450px; left: 495px; margin-top: 75px; } .logo3{ font-size: 80px; font-weight: bold; margin-left: 75px; position: absolute; margin-top: 80px; } .text{ position: absolute; font-size: 30px; margin-top: 200px; margin-left: 40px; } .Button img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 8.png); position: absolute; background-size: cover; height: 75px; margin-top: 400px ; margin-left: 75px; } .Podrobno{ font-weight: bold; color: teal; font-size: 40px; margin-top: 407px; margin-left: 150px; position: absolute; } .logo_picture3 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 9.png); background-size: cover; position: absolute; height: 450px; left: 100px; margin-top: 75px; } .logo4{ font-size: 80px; font-weight: bold; margin-left: 800px; position: absolute; margin-top: 80px; } .text2{ position: absolute; font-size: 30px; margin-top: 200px; margin-left: 770px; } .Button2 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 8.png); position: absolute; background-size: cover; height: 75px; margin-top: 400px; margin-left: 800px; } .Podrobno2{ font-weight: bold; color: teal; font-size: 40px; margin-top: 407px; margin-left: 875px; position: absolute; } .logo_picture4 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 10.png); background-size: cover; position: absolute; height: 450px; left: 430px; margin-top: 75px; } .logo5{ font-size: 80px; font-weight: bold; margin-left: 60px; position: absolute; margin-top: 80px; } .text3{ position: absolute; font-size: 30px; margin-top: 200px; margin-left: 40px; } .Button3 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\Слой 8.png); position: absolute; background-size: cover; height: 75px; margin-top: 400px ; margin-left: 50px; } .Podrobno3{ font-weight: bold; color: teal; font-size: 40px; margin-top: 407px; margin-left: 127px; position: absolute; } .text_os{ color: #033; font-size: 80px; text-align: center; margin-top: 200px; } .text_info{ color: white; font-size: 35px; margin-left: 550px; margin-top: 40px; position: absolute; } .social_net1 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\2.png); position: absolute; background-size: cover; height: 90px; margin-left: 660px; margin-top: 150px; } .social_net2 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\4.png); position: absolute; background-size: cover; height: 90px; margin-left: 780px; margin-top: 150px; } .social_net3 img{ background-image:url(C:\Users\TheNay\макетдляWordPress\assets\images\3.png); position: absolute; background-size: cover; height: 90px; margin-left: 900px; margin-top: 150px; } .number{ color: white; font-size: 50px; position: absolute; margin-top: 120px; margin-left: 40px; } .telephone_hot{ color: aquamarine; font-size: 30px; position: absolute; margin-top: 80px; margin-left: 79px; }
У вас файл называется function.php или functions.php? Правильно
functions.php
, только файл под таким именем подключиться автоматически в теме.Спасибо огромное)))Я думала, а коньки отброшу 3 месяца уже пытаюсь