Cannot link CSS file
-
Hello, I have been trying for days now to link my CSS page into my wordpress page.
They are hosted locally on my computer via MAMP. I am trying to build a custom theme at the minute and
This is the error code I get via the chrome developer console:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)I have tried several different methods to get the CSS to link but it won’t work. I don’t know if it has anything to do with the PHP Configuration but MAMP suggests the PHP config is fine.
Here are my files. (Excuse the file names, I was following a youtube tutorial.)
style.css files
/*
Theme Name: Awesome Theme
Author: Adam
Version: 0.0.6
Description: This is an awesome theme
Tags: Testing, Sample, Please work
Licence: GNU General Public License v2 or later
/*Background {
color: blue;
}functions.php file
<?phpfunction awesome_script_enqueue() {
wp_enqueue_style(‘customstyle’ , get_template_directory_uri() , ‘/css/awesome.css’ , array(), ‘0.0.6’ , ‘all’);
wp_enqueue_script(‘customjs’, get_template_directory_uri() , ‘/js/awesome.js’ ,array(), ‘0.0.6’, true);
}add_action(‘wp_enqueue_scripts’, ‘awesome_script_enqueue’)
?>awesome.css file
html,
body {
margin: 0;
color: blue;
background: grey;
font: sans-serif;}
body {
padding: 20px;
}index.php
<?php get_header(); ?>
<h1> This is my index </h1>
<?php get_footer(); ?>footer.php
<footer>
<p> This is my footer </p>
</footer>
</body>
</html><b> header.php</B
<!doctype html>
<html>
<head>
<meta charset=”utf-8″>
<title> Awesome Theme </title>
<?php wp_head(); ?>
</head>
<header> This is my header</header><body>
- The topic ‘Cannot link CSS file’ is closed to new replies.