Support » Theme: Zerif Lite » Video background
Video background
-
Is the video background as you see on this site, http://www.anan.pro , a feature in Zerif Pro or is it a plugin?
-
Hello,
That is now a feature for Zerif pro. i’m assuming that was done with some heavy code customization, support we don’t offer.
Best regards,
AlexandraI went into the Pro demo and saw that a slider was available, but no background video.
You may do like this: i have put this code in a child-theme’s home-page.php just below: <div id=”content” class=”site-content”>
<div id=”homevideo”>
<video autoplay loop>
<source src=”url_2_file.mp4″ type=”video/mp4″ />
</video>
</div>the css is as follows:
#homevideo {position: fixed; top:0; left:0; z-index: -99; width: 100%; height: 100%;}
video {width:100%; height:auto;}Ofcourse you may add alternative sources, as reccommended all over the web when it comes to html5 video. I would also hide the video on mobile, but that’s up to you!
Thank you so much for your insight. I’m not familiar with php like an expert so I wouldn’t know how to hide video on mobile.
I know how to insert your code though. 🙂
This leads to another question. I recently created a child’s theme, which I did to prevent one of my forms from being tampered with every time there is an update. Do I need to download ALL php files from the parent theme to the child’s theme? Otherwise, the home-page.php that you mentioned is still in the parent theme.
You should only copy files that you are going to change and front-page.php if you change sections because you will need to replace get_template_directory() with get_stylesheet_directory() for every section that you are going to change.
Thank you, Marius. I’ve changed most of the sections but haven’t had any issues when there has been an update. So, let me get this straight….in the front-page.php, every section that I have changed, I need to replace what you said?
If you are using a child theme and you have modified section files in the child theme, then you also need to make the modifications I mentioned earlier in front-page.php
For example, if I create a child theme and want to customize big_title.php and add some extra content there. First, I would create a file in /zerif-child/sections/big_title.php, then I would make my customizations.
Even though I removed/added content, nothing will be shown because in front-page.php it uses the original big_title.php from the parent theme, so next you want to add front-page.php to your child theme and then make the replacements I mentioned in my previous post.
Thank you for all of your help!
This problem in
front-page.php
is also described here (including fix).The correct way to include files compatible for use with a child theme is via
get_template_part()
function of WordPress (docs here).In where should I input the
<div id="homevideo"> <video autoplay loop> <source src="url_2_file.mp4" type="video/mp4" /> </video> </div>
I don’t see “home-page.php” in Zerif Lite dir, I did put it in “home.php”, but it doesn’t work. Nor in front-page.php or index.php
@islasbaleares, Start by creating a Child Theme. If you need help with that process then you should open a new thread: https://wordpress.org/support/theme/zerif-lite#postform
Thanks Andrew, oh so that is neccesary to create a child theme in order to achieve what was mentioned above?
Changing the default files is pointless then? It seems whatever I change has absolutely no effect on anything in frontend.
Sorry, I’m a bit novice in WordPress
- The topic ‘Video background’ is closed to new replies.