Я пытаюсь создать пользовательскую тему для wordpress, я создал все эти файлы:
style.css index.php function.php footer.php header.php page.php single.php front-page.php
Это код моего стиля.css:
/* Theme name: La Pizzeria Theme URI: http://www.matteoschiatti.it Author: Matteo Schiatti Author URI: http://www.matteoschiatti.it Description: Theme for Restaurants Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/license/glp-2.0.html Tags: restaurant, mobile first, responsive, pizza Text Domain: lapizzeria; */ body { background-color: #000; } .test { color: red; }
Это код моей функции.php:
<?php function lapizzeria_styles() { //Adding stylesheets wp_register_style('style', get_template_directory_uri() . '/style.css', array(), '1.0'); //Enqueue the style wp_enqueue_style('style'); } add_action('wp_enqueue_scripts', 'lapizzeria_styles');
Это функция моего header.php:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>La pizzeria</title> <?php wp_head(); ?> </head> <body> <span class="test">fdsafdsafdsafsdafsdafsdafdsafsa</span>
А в других файлах есть внутри этого кода:
<?php get_header(); ?> <?php echo "la pizzeria"; ?> <?php get_footer(); ?>
Я не могу понять, почему style.css не работает, заголовок встроен правильно, потому что я вижу заголовок страницы, поэтому я думаю, что есть некоторая проблема с функцией в файле function.php.
function.php должен быть functions.php.