![]() ![]() To do that, add the autoplay parameter to your shortcode like this: ĭue to recent changes in the autoplay policy, some browsers require the video to be muted to play automatically. You may want to show a video to your visitors right after page load. ![]() Notice how we're using $i to create unique class for each trigger element in the loop. Matches trigger element class.Įcho do_shortcode( ']' ) Notice how we're using $i to create unique ID for each shortcode in the loop. $video_url = get_sub_field( 'video_url' ) ![]() $image = get_sub_field( 'image' ) // This is set to "Image URL" in the ACF settings. In the loop, add +1 to $i to create a unique ID further down. While ( have_rows( 'videos' ) ) : the_row() This will be used to construct unique ID's for the WP Video Popup shortcode & trigger element. Here is how the repeater field is set up in ACF:Īnd this is what the code in your template file could look like: // Check if rows exists (repeater field ID). The setup is fictional where we’re using an image to trigger the video. In the example below, we are learning how to add multiple videos to a single page/post by using an ACF PRO repeater field. The shortcode would then look something like this: ĪCF PRO – Repeater field integration (example) To add self-hosted videos simply upload your video to your own server. Keep in mind that If you are not going to have multiple popups on a single page with the PRO version, the regular shortcode must be used. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |