• Resolved jmvandeel

    (@jmvandeel)


    Hi, I have a post with a background video that I put as a sticky post on the homepage. But the background video is not shown on the homepage. When I click on the post, the background video is showing. But I want this on the homepage too.
    Please advise.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author pushlabs

    (@pushlabs)

    Hi jmvandeel,

    Thanks for using Video Background!

    If you want the video background on the home page as well, you’ll need to add the shortcode or the options to the metabox on the actual homepage page in WordPress, in addition of the blog post.

    Blake

    Thread Starter jmvandeel

    (@jmvandeel)

    Hi Blake,

    thank you for your reply. But i’m not sure how to do that. My homepage is not a static page, but showing the latest 10 posts.
    Please advise.

    Plugin Author pushlabs

    (@pushlabs)

    Oh I see. In that case, I would recommend creating a function in your functions.php file that executes a shortcode in the footer. That shortcode could be a Video Background shortcode.

    Alternatively, you could set a blank page as a “home” page in settings, and add the video background settings on that page in the metabox ??

    Blake

    Thread Starter jmvandeel

    (@jmvandeel)

    Thank you, that worked. I have added the following code to my child theme function.php:

    /* Adding the video backgroun to the footer on the homepage only */
    add_action('wp_footer', 'add_video_background');
    function add_video_background(){
    if(is_front_page()) {  
    	echo do_shortcode( '[vidbg container="#post-252" mp4="Traffic_disco.mp4" webm="Traffic_disco.webm" poster="Traffic_disco.jpg" muted="true" loop="true" overlay="false" overlay_color="#000" overlay_alpha="0.1"]' );
    	}
    };

    Only the alpha seems not to work, but thats no issue for now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Homepage with latest posts not showing post background video’ is closed to new replies.