0

I have the following code on my wordpress page but none of it is being formatted by the style.css file. Everything is in a folder titles 'Web Services' that i place directly into the wp-content/themes folder. All it does is print the plain text.

Header.php:

    <meta name="description" content = "Welcome to Flier Web Design!" />
    <meta name="keywords" content = "Premium, Web, Design, Web Design, fast, easy" />
    <meta name="author" content = "Corey" />
    <title>Our PHP Template</title>
</head>
<body>
    <div id="header">
        <div id="logo">
        <p>LOGO</p>
        </div>
    </div>
    <div id="hsubcribe">
        <p>Header Subscribe</p>
    </div>
    <div id="navbar">
        <p>navbar</p>
    </div>

sidebar:

<div id="sidebar">
<p>sidebar</p>
</div>

footer.php:

<div id="footer">
<p>footer</p>

functions.php:

index.php:

<?php get_header(); ?>

<div id="content">
<div id="contentleft">
<style>font-size: 300px;</style>
    <p>indexpage</p>
</div>

<?php get_sidebar(); ?>
</div>

<?php get_footer(); ?>

style.css:

/*
Theme Name: Web Services
Author: Corey
Description: First Template
Version: 1.1
License: None
License URI: http://flierwebdesign.com
Text Domain: flierwebdesign
*/

body {
margin: 0px;
padding: 0px;
background-color: yellow;
font-family:Calibiri, Arial, Tahoma;

}
#header {
width: 900px;
margin: 0px auto 0px auto;
border: 1px solid #000;
clear: both;
}
#logo {
width: 400px;
float: left;
border: 1px solid #000;
}

#hsubscribe {
width: 400px;
float: right;
border: 1px solid #000;
}
#navbar {
width: 900px;
margin: 0px auto 0px auto;
border: 1px solid #000;
clear: both;
}
#content {
width: 900px;
margin: 0px auto 0px auto;
border: 1px solid #000;
clear: both;

}
#contentleft {
width: 900px;
margin: 0px auto 0px auto;
border: 1px solid #000;
clear: both;
}
#sidebar {
width: 300px;
float: right;
border: 1px solid #000;
}
#footer{
font-size: 300px;
width: 900px;
margin: 0px auto 0px auto;
border: 1px solid #000;
clear: both;
}
2
  • 1
    You're missing wp_head() - check out one of the default Twenty XX themes for an example of how templates should look. Commented Apr 30, 2018 at 17:38
  • thanks. Will definitely be looking through those themes. Commented May 1, 2018 at 4:41

1 Answer 1

2

You need to add wp_head() hook before closing of <head> tag hook at header where all the enqueued files will be added dynamically. Check https://developer.wordpress.org/reference/functions/wp_head/

Also don't forget to put wp_footer() at your footer.php file. See https://codex.wordpress.org/Function_Reference/wp_footer

5
  • thanks. I was on this for 4 hours editing the functions.php and style.css files trying to find out what I was missing. I was following a normal php tutorial and wanted to test it, but WordPress was already installed on my server so I wasn't sure what was missing. Commented May 1, 2018 at 3:21
  • I added: <?php wp_head(); ?> </head> and <?php wp_footer(); ?> </body> but still shows unformatted Maybe I should just restart from an existing template. Commented May 1, 2018 at 3:39
  • you need to enqueue your styles and scripts Commented May 1, 2018 at 3:47
  • See some examples here developer.wordpress.org/reference/functions/wp_enqueue_style Commented May 1, 2018 at 3:48
  • thanks. The enqueue is really confusing. Had it pointing to the wrong directory. This was killing me! Commented May 1, 2018 at 4:39

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.