Skip to main content
deleted 6 characters in body
Source Link
Nathan Johnson
  • 6.5k
  • 6
  • 30
  • 49

I've got a simple header file which calls the wp_head method, however when i inspect the source the css links are made in the body and the is<head> is empty.

My header.php:

<!DOCTYPE html>
<html lang="en">

<head>
<?php wp_head(); ?>
</head>
<body>
<?php get_template_part( 'components/navigation/navigation', 'main' ); ?>

My functions.php:

<?php 
function load_scripts() {
    echo ' test';
    wp_enqueue_style( 'style', get_stylesheet_uri() );
    }
    add_action('wp_enqueue_scripts', 'load_scripts');

?>

Thanks!

I've got a simple header file which calls the wp_head method, however when i inspect the source the css links are made in the body and the is empty.

My header.php:

<!DOCTYPE html>
<html lang="en">

<head>
<?php wp_head(); ?>
</head>
<body>
<?php get_template_part( 'components/navigation/navigation', 'main' ); ?>

My functions.php:

<?php 
function load_scripts() {
    echo ' test';
    wp_enqueue_style( 'style', get_stylesheet_uri() );
    }
    add_action('wp_enqueue_scripts', 'load_scripts');

?>

Thanks!

I've got a simple header file which calls the wp_head method, however when i inspect the source the css links are made in the body and the <head> is empty.

My header.php:

<!DOCTYPE html>
<html lang="en">

<head>
<?php wp_head(); ?>
</head>
<body>
<?php get_template_part( 'components/navigation/navigation', 'main' ); ?>

My functions.php:

<?php 
function load_scripts() {
    echo ' test';
    wp_enqueue_style( 'style', get_stylesheet_uri() );
}
add_action('wp_enqueue_scripts', 'load_scripts');

?>

Thanks!

Source Link
Niek
  • 143
  • 1
  • 3

wp_head() outputs in body

I've got a simple header file which calls the wp_head method, however when i inspect the source the css links are made in the body and the is empty.

My header.php:

<!DOCTYPE html>
<html lang="en">

<head>
<?php wp_head(); ?>
</head>
<body>
<?php get_template_part( 'components/navigation/navigation', 'main' ); ?>

My functions.php:

<?php 
function load_scripts() {
    echo ' test';
    wp_enqueue_style( 'style', get_stylesheet_uri() );
    }
    add_action('wp_enqueue_scripts', 'load_scripts');

?>

Thanks!