I am writing a theme on wordpress. I connected third-party libraries, everything is fine, but my style file does not work ....
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> <link rel="stylesheet" href="style/mystyle.css"> <link rel="stylesheet" href="style.css"> <!-- Данное подключение тоже не срабатывает <link rel="stylesheet" href="http://mysite.com/style/mystyle.css"> <link rel="stylesheet" href="http://mysite.com/style.css"> --> <!-- И это тоже подключение тоже не срабатывает <link rel="stylesheet" href="./style/mystyle.css"> <link rel="stylesheet" href="./style.css"> --> <?php wp_head(); ?> </head> <body> <h1 class="red">RED</h1> mystyle.css:
.red { color: red; } footer.php:
<!-- FOOTER --> <h1>FOOTER</h1> <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"> </script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"> </script> <?php wp_footer(); ?> </body> </html> Adding wp_head () and wp_footer () also did not solve the problem ....
The default wordpress project was created, the wp_my_themes folder was created in the themes (wordpressproject.com/www/wp-content/themes).
wp_my_themes folder contents:
style (в этой папке лежит файл mystyle.css) 404.php (файл пуст) footer.php (содержимое написано выше) functions.php (файл пуст) header.php (содержимое написано выше) index.php (содержимое написано выше) page.php (файл пуст) screenshot.png (картинка темы) style.css (файл пуст, в комментах данные для описания темы)
href="./style/style.css"- user242433404error for this file, look at how the absolute link to the file is formed there, and understand what is wrong. - Raz Galstyan404 not found), you don’t write the negative path correctly, and there is no one who can give a specific answer, since the hierarchy of your site is not knows not who. just see how they give file paths when connecting, ( htmlbook.ru/samhtml/ssylki/absolyutnye-i-otnositelnye-ssylki ) - Raz Galstyan<link rel="stylesheet" href="style/mystyle.css">like that is<link rel="stylesheet" href="style/mystyle.css">wrong. The relative link is relative to the requested page. - SeVlad