Site logo

Archived topic

Site-wide background body image/video via PHP or shortcode?

7 replies · Started by Michael on September 4, 2018

Viewing posts 1–8 of 8

Hi,

I'd like to use a slider plugin to insert site-wide, full page images and/or videos behind the body content of page. This is as a alternative to Customizer > Background Images > Body.

With the plugin I'm using, I have the option of inserting PHP code or a shortcode. I've read over various threads but I can't seem to get it working correctly. I can do static images through CSS but can't see to get it working with the plugin.

I can get it working through Elements > Hook locations but none seem to stick in the body of page.

What is the best approach in accomplishing this?

Hi David,

Thanks for the response, however, let me rephrase the question: where can I insert either PHP code or a shortcode to control the body background?

Hi there,

the before_header_hook is the first hook inside of the body. I am not sure what or how the plugin works but generally the video element is added to the container and then absolutely positioned to display behind the content.

This article explains how it is done for the page headers.

https://docs.generatepress.com/article/page-hero-background-video/

Hi David,

I'm using Smart Slider Pro 3. I added "position: absolute;" but now it seems to cover up the content. I assume I have to further assign the z-index?

Also, you reference an article regarding page header but there was no link in your post.

That worked! Thank-you!

Awesome. Glad i could help

This archived topic is closed to new replies.