Header page coding tutorial for your custom theme

wp header code image

Header page coding is needed for making all the upper section dynamic. So, you will get same changes in all your pages through editing a single php page. I will teach you the codes for the same in this tutorial. However, you can get the complete chapters from my wordpress theme development tutorial.

Please open your cpanel and theme folder. Then create header dot php page. Open that page after that and start writing codes. Please note, all the codes will be starting with less than and end with greater than. Our first code is Doctype html. Next is the language setup part. Therefore, write down html first and end html. Finally, write lang attributes or lang en before the first html closing tag.

Next tags are head and head close. Write meta character set information right after that. In other words, the next code is php bloginfo charset. Make sure about writing a question mark after less than tag. Then write php and it’s function name with bloginfo.

We will be writing the title tag after that. Two codes can be settled there. One of them is php wp title and the next one is php bloginfo name. You can write only one of them as per your choice. Write down profile link right after that. The href will be gmpg for that.

Then write down ping back without space in the header page. Again, the href will be ping back (without space) underscore url. Finally close the php tag. Now we will be writing jquery for our page. Therefore, it will become more professional. The code will be (is singular, get option, thread comments, wp enqueue scripts, comment reply) php ending tag.

A similar header coding tutorial is available for writing header page tags directly in index page.