Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Diego Villaseñor
Diego Villaseñor
12,615 Points

DOCTYPE not appearing

Hello, just now I was checking this site I made in Wordpress, and noticed that the DOCTYPE declaration was no rendering. I'm not sure what's going on. You can check the site here: http://www.astridasher.com/

My code on header.php is as follows:

<!DOCTYPE html>
<html class="no-js" lang="es" >
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><?php wp_title(); ?></title>

  <?php wp_head(); ?>

Any ideas?

PS: I'm using foundation, if that of any help.

2 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Hey there!

I'm not sure how the wp_head() hook works, but it looks like it's supposed to be inside your document's head tags. Try adding those and see if it works.

<!DOCTYPE html>
<head>
<?php wp_head(); ?>
</head>

Edit yeah, the WP Codex for the function says to put it just before the closing head tag.