Archived topic
How to put video into header
5 replies · Started by chris on November 23, 2018
Hi GP Team
Is there a simple way to use a video in the page header?
I have read the following but still none the wiser.
https://docs.generatepress.com/article/page-hero-background-video/
Seems like earlier versions of GP had the option to include header video in the Headers section at the click of a button.
Where or how to insert do I insert the HTML code and CSS?
Thanks
Hi there,
The HTML can go into the page hero content.
You can copy and paste the code in and just replace URL/TO/video part.
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this helps :)
Thanks Leo
I wanted to link to a Youtube video. Could not get it to work. Uploaded video to my site and it worked. Please confirm if I can link to a Youtube video in the header as I would prefer this way.
Lastly. The top of the first 2 posts were originally on top of the header picture creating a nice effect. Now they are behind the video. Anyway to get them in front of the video?
Thanks
I believe you need the actual source URL to the video for it to work as a background, and I don't think YouTube gives that to you, unfortunately.
For the overlap issue, add this CSS:
.page-hero + #page {
position: relative;
}
Tom
Yep that works. All good thanks.
Chris
You're welcome :)