Adding a video header to WordPress themes

Adding a video header to WordPress themes

Header images are nothing new, but header videos are coming into fashion. Adding a video header to WordPress Themes can highlight your product or service in a new or innovative way.

The theme that I will be using is twenty twenty and it does not have video support for the header. Since I made a child theme I will be using that to modify the files.

Here are the steps to follow

    1. Open up the themes/twenty-twentychild/functions.php file with a code editor
    2. Add the following line of code and save the file –
    3. Log into the WordPress dashboard as the administrator
    4. Click the Appearance menu
    5. Choose the Header Media option to open the customizer
      header media
    6. Click Select Video to upload the video
    7. Choose the video after uploading it and add it to the customizer
    8. Now the header video will be shown in the header media section
    9. Click Publish
    10. Open the Header.php file in the child theme and add the following code –

Open the style.css file and add the following code –

Save the changes and refresh the customizer Header media section, now you will see the video in your theme.


References/Resources:

  1.  WordPress
  2.  Child theme creation

 

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.



Updated on