How to make WordPress theme header file

Hi, in Develop theme header of WordPress post I am going to show you how to develop a custom header.php or common header for WordPress theme from an HTML pice saved as header.php

First I am describing the code should be used for header portion and then will show a sample header code with HTML

  1. The code or function > is used in the starting HTML tag for the language of the site.
  2. is used to get the HTML default charset.
  3. <?php wp_title ( '' ); if (is_front_page()) { bloginfo ( 'name' ); echo ' - '; bloginfo ( 'description' ); } ?> is used to get the page title according to the site name and page name and description.
  4. is used for getting the theme defining style.css file which is located in the theme root folder.
  5. is used to get the pingback URL
  6. is used to get the default header portion as CSS some js of WordPress.
  7. is used to define the unit body class for each page it also generated some default classes of WordPress body.
  8. To include the other CSS located in the theme directory include theme style.css which is located in the root directory of the theme defining the theme. Or place to give the theme URL or its links.

 

Now the sample code



>




<?php wp_title ( '' ); if (is_home ()) { bloginfo ( 'name' ); echo ' - '; bloginfo ( 'description' ); }  ?>









>

 

in this post, you have learned how to develop a custom header.php or common header for WordPress theme,

In our next post will learn how to define menus in functions.php and used them in frontend and make them dynamic.

Thanks for Reading

Share The Post On -

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.