Wordpress : header.php


/ Published in: PHP
Save to your folder(s)

<pre><code>* Use the proper DOCTYPE.
* The opening tag should include language_attributes().
* The "content-type" meta element should be placed before everything else, including the title element.
* Use bloginfo() to fetch the title and description.
* Use automatic feed links to add feed links.
* Add a call to wp_head(). Plugins use this action hook to add their own scripts, stylesheets, and other functionality.
</code></pre>

<p>Here's an example of a correctly-formatted HTML5 compliant head area:</p>


Copy this code and paste it in your HTML
  1. <!DOCTYPE html>
  2. <html <?php language_attributes(); ?>>
  3. <head>
  4. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  5. <title><?php wp_title(); ?> <?php bloginfo( 'name' ); ?></title>
  6. <link rel="profile" href="http://gmpg.org/xfn/11" />
  7. <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen" />
  8. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  9. <?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
  10. <?php wp_head(); ?>
  11. </head>

URL: http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.