1

I'm trying to create a custom theme for wordpress, I created all these file:

style.css index.php function.php footer.php header.php page.php single.php front-page.php

This is the code of my style.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;
}

This is the code of my function.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');

This is the function of my header.php:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>La pizzeria</title>
    <?php wp_head(); ?>
  </head>
  <body>
 <span class="test">fdsafdsafdsafsdafsdafsdafdsafsa</span>

And in the other files there is inside this code:

<?php
  get_header();
?>

<?php
  echo "la pizzeria";
?>

<?php
  get_footer();
?>

I cannot understand why the style.css doesn't work, the header is embedded properly because I can see the title of the page so I think there is some problem with the function in the function.php file.

1 Answer 1

2

function.php should be functions.php.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.