Site logo

Archived topic

Add Video Background to Simulate parallax

1 reply · Started by Ryan on May 15, 2018

Viewing posts 1–2 of 2

Hi Guys! So far so good with GP!

I am trying to add video to the background of a page header while using a transparent image so I can simulate a parallax background. I just need to target the right div.

How can I add a function to insert code after the page header tag?

I have tried this:

add_action( ‘generate-inside-page-header-content’, ‘home_page_video’ );
function home_page_video() {
if ( is_front_page() ) {
?>

<video autoplay muted loop id=\’myVideo\’>
<source src=\’http://104.254.95.130/~catapultwp/wp-content/uploads/2018/05/rivertemp2-1.mp4\’ type=\’video/mp4\’>
Your browser does not support HTML5 video.
</video>

<?php
}

}

Maybe Tom has another solution but you could consider adding the video in the page header background video and then adding your image as background to the .generate-content-header element. This is where the vide background overlay would normally go.

This archived topic is closed to new replies.