How to Autoplay Videos Using Avia Layout Builder in Enfold

//How to Autoplay Videos Using Avia Layout Builder in Enfold

How to Autoplay Videos Using Avia Layout Builder in Enfold

Enfold is one of the most popular themeforest WordPress theme; it is elegant and powerful. Also the theme comes with demo content, so it makes very easy to setup to look like demo. The theme also comes with many features; Avia layout builder is one of them, but it has its limitation. One of most annoying parts about Avia layout builder is video. You can only be able to paste url in the field; there is no option of autoplay.

One of my clients just had this request that wants videos to be auto playing whenever visitors landing on the page. At first, I thought there should be an option for embed video codes or a box to check for auto playing, but I saw none of those. So, I figured hard coding is the only option.

Now, to do that, first connect to ftp or login to cPanel and click file manager.

Next, browse to wp-content/themes/Enfold/framework/php/function-set-avia-frontend.php

And then look for

$output .= '<video class="avia_video" '.$image.' controls id="'.$uid.'" >';

add autoplay to it, so it will look like

$output .= '<video autoplay class="avia_video" '.$image.' controls id="'.$uid.'" >';

After that, you can click save, and re-upload  the file

Now, when you go back to your video page and refresh the page, you will see video being replayed.

Always, before do anything, backup files first.

Hopefully, this trick is helpful to anyone who is using Enfold and trying to figure out how to make video auto playing. As always, if you have any question, leave a comment below.

Related:  What To Do If Your WordPress Site Has Been Hacked

About the Author:

Founder of Siteber: a full-stack web developer with more than 8 years working experience in WordPress, SEO, and internet marketing.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.