wordpress header code

Commonly used header code in wordpress theme

In wordpress theme, header.php file plays a vital role for theme developer. Every web developer who develop WordPress Theme they must use some common wordpress header codes in header.php file which are come from wordpress.org website.

This header.php file contains all the necessity information such as document type, title, Meta tag and many more. In this article I am going to write down some widely and commonly use wordpress header code in header.php file for WP Theme Developer.

<!DOCTYPE html>
<html <?php language_attributes(); ?>> <!--Dynamic language attribute-->

<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/> <!--Wordpress Dynamic Charset-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><!--Need to use this code for responsive purpose-->
<title><?php wp_title( '-', true, 'right' ); ?></title> <!--Page Title-->
<link rel="profile" href="http://gmpg.org/xfn/11"><!-- Used by WordPress itself-->
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <!-- WordPress Ping Back -->
<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico"> <!--Place your favicon.ico file in theme root folder-->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_uri(); ?>"> <!--Theme Style.css file going to load. -->
<?php wp_head(); ?> <!-- This code going to used by plugins and you must add this code-->
</head>

<body>

</body>

</html>

Published by

Emdad Khan

I am Emdad Khan, A WordPress Theme Developer and Author of BN Web Design Website. A full time Freelancer on WordPress Theme Development & Optimization as well as blogger.

Leave a Reply