Tuesday, September 1, 2020

How to Edit the Header in WordPress

In this quick tip you’ll learn how to edit the header in WordPress. It’s easier than you might think, so let’s get started!

Edit the Header in WordPress

Here’s a complete video version of this WordPress quick tip. Don’t forget to subscribe to our Envato Tuts+ YouTube channel for tutorials, free courses, and more!

On the “front end” of your WordPress website the “header” is the upper part of the page:

the Header in WordPress

The header will usually contain your website’s logo, some navigation, perhaps a search box, and maybe some additional links.

It appears (under normal circumstances) in exactly the same way across all the pages of your website, and its contents sit in a file called “header.php”; one of the files in your active theme folder.

Note: bear in mind that the contents of header.php will be different for every theme.

How to Edit the header.php File in a Code Editor

To find the file and edit it yourself go to wp-content > themes > your-theme-name > header.php.

You can then open it in a code editor and make any changes you need to. But bear in mind that editing any of your theme’s php files could cause things to break!

How to Edit the header.php File Via WordPress Admin

To edit this same file via the WordPress admin, go to Admin > Appearance > Theme Editor to find the file.

In the right hand sidebar make sure you select the currently active theme:

 Edit the headerphp File Via WordPress

header.php will then be labeled Theme Header to help find it easily.

Make the changes you need, and hit Update File. WordPress will run a quick PHP check to make sure your code changes don’t cause any problems, but it’s always worth cautioning against making direct changes without sufficient backups.

That’s How to Edit the Header in WordPress

Editing the header file in WordPress can be a really useful thing to know how to do, and it’s a great first step towards properly developing your WordPress theme!

Learn More About Using WordPress

If you’re relatively new to WordPress, why not try some of our other beginner’s tutorials and tips:

WordPress Theme Inspiration

We have a tonne of WordPress theme roundups for you on Tuts+; take a look at these to see if any will work for your next project!

No comments:

Post a Comment