• Resolved genuus

    (@genuus)


    Hi guys. I’m newbie in WP. I successfully installed new 4.9 WP on my server. And now I’m looking for how to make new theme. So I created a new folder in wp_content/, made index.php; style.css; footer.php and header.php. Wrote description in style.css and activeted my new theme. It’s all good and cleare. Now I want to add custom css file. So I have that file here css/whatever.css in my theme folder. I wrote the simplest index-header-footer-css. All works. But when I add wp_head to header.php site displays blank page. What am I doing wrong? Help please.

    index.php

    <?php get_header(); ?>
    
        <h1>Hi everybody</h1>
        
        <?php get_footer(); ?>
    

    header.php

    <!DOCTYPE html>
     <html>
      <head>
          <meta charset="utf-8">
         <title>Title of the document</title>
    	<?php wp_head(); ?>
    </head>
    
      <body>
    

    footer.php

    
    <footer>
        <p>That's the footer</p>
    </footer>
    
        </body>
    </html>
    

    function.php

    <?php
    
    	function gogoflow_scripts() {
    	    
        wp_enqueue_style( 'customstyle', get_template_direcrory_uri() . '/css/whatever.css', array(), '1.0.0', 'all');
        
    }
    
    add_action( 'wp_enqueue_scripts', 'gogoflow_scripts');
    

    whatever.css

    html,
    body {
        margin: 0;
        color: #333;
        background: #eee;
    }
    
    • This topic was modified 7 years ago by genuus.
    • This topic was modified 7 years ago by genuus.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hi genuus, welcome to the WP community!

    You’ve marked this topic as resolved. If that is indeed the case, you may ignore the rest of this reply. FYI, it’s a good practice to post the solution you arrived at in order to help others who may land on your topic with a similar problem. We realize that some solutions are so unique (i.e. silly one-off errors) that posting a solution would not help anyone.

    I’m mainly posting a reply so that resolved topics fall off of the “No Replies” list that many of us use to find those still needing help. If you still need help, go ahead and reply.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_head doesn’t work’ is closed to new replies.