Introduction
Your site’s WordPress header is really important. It is the first thing your visitors will see and more importantly. It is also where we can insert scripts and code to enhance and extend the site’s capabilities and features. Given this, we might find that we need to edit the header of the WordPress site. As we will learn this easy to do.
In this tutorial, we will learn how to edit the WordPress header of a WordPress site.
Let’s start.
Editing the WordPress Header
Editing through the Live Editor
The easiest way to edit the WordPress header is through the admin dashboard. To do this, hover over Appearance item on the admin dashboard then click on Header
This will take you to the WordPress Live Editor’s Header editing section. Here you can edit the appearance of your header. Once here, we can choose to modify the appearance of the header.
We can choose to embed a video by uploading an .mp4 file:
Or we can choose to embed a YouTube video by providing its link in the appropriate text field.
We can also change the header image. To do this click on the “Add new image” button.
Once we do that, we can choose an image to replace the header image.
Lastly, we can even hide the header image, if needed.
Editing the Headers through a Plugin
The previous method only allows us to change the appearance of the WordPress header. However, we may need to add scripts as well to enhance how the site behaves and what it can do. To do this, we can use the Insert Header and Footer plugin. This plugin can be installed and activated through the admin dashboard.
Once the plugin is installed, we can add the scripts we need through the admin dashboard. To do this, navigate to the Insert Headers and Footers page form the admin dashboard.
Here we can add the scripts we need in the first textbox.
Editing the header.php file
If you need more control than what the previous methods require, you can always edit the header.php file of your theme. To do this, hover over Appearance then click Theme Editor
You will be prompted to whether you would like to proceed with editing. There is also an option to create a child theme to make modifications. For our tutorial. we will proceed with editing.
Look for the header.php link on the right sidebar and click on it:
This will redirect us the code of the header.php file. From there we can edit the code and then save it.
Alternatively, you can choose to edit the header.php file and then upload it through FTP if you have access to the remote server. You should place the file the appropriate folder your current theme’s folder or subfolder. In our example, below in the twentyseventeen theme’s folder.
Conclusion
That’s all for this tutorial, We have learned how to edit the header through, the Live Editor, through a plugin and through, editing the header.php file itself. Now you can edit the header of our WordPress site when you need to.
Leave a Reply