
-
AuthorPosts
-
March 30, 2019 at 6:30 am #1084807
My current wordpress theme (non-enfold) allows Vimeo embedding that plays via a Lightbox AND shows the video description entered on vimeo beneath the lightbox video. How do I accomplish this in the Enfold theme? I utilized the Image function while entering a vimeo URL but the vimeo description doesn’t appear. Is there any way to accomplish this with Enfold? Thanks!
-
This topic was modified 5 years, 11 months ago by
kkirchem.
April 3, 2019 at 5:23 am #1086348Hey kkirchem,
Thank you for using Enfold.
Have you tried using the same description for the image in which you link the vimeo media file? You can add the description as the title of the image in the Media > Library panel.
Best regards,
IsmaelApril 3, 2019 at 5:36 am #1086352Thanks Ismael. I tried your suggestion (adding a description to the image link) but no wording appears under the video when it plays in Lightbox. Let me know if there is any other way to do this (maybe CSS). Thanks.
April 5, 2019 at 4:06 pm #1087500Hi,
Thanks for the update.
You may need to re-initialize the lightbox using different parameters. First, turn on the custom css class field so that you can add a unique class attribute to the image element. Once the field is activated, edit the image element and then add the “mfp-video” text in the css class field. To initialize the light script, use this code in the functions.php file.
add_action('wp_footer', 'ava_init_video_lightbox'); function ava_init_video_lightbox(){ ?> <script type="text/javascript"> (function($) { function videoLightbox() { $('.mfp-video a').magnificPopup({ type: 'iframe', mainClass: 'mfp-with-fade', iframe: { markup: '<div class="mfp-iframe-scaler">' + '<div class="mfp-close"></div>' + '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>' + '<div class="mfp-description mfp-description-video"></div>' + '</div>', patterns: { youtube: { index: 'youtube.com/', id: 'v=', src: '//www.youtube.com/embed/%id%?autoplay=1' }, vimeo: { index: 'vimeo.com/', id: '/', src: '//player.vimeo.com/video/%id%?autoplay=1' } }, srcAction: 'iframe_src', }, callbacks: { markupParse: function (template, values, item) { values.description = item.el.find('img').attr('title'); } }, }); } $(document).ready(videoLightbox); })(jQuery); </script> <?php }
Don’t forget to purge the cache before checking the page.
Best regards,
IsmaelApril 11, 2019 at 5:28 pm #1089633So do I just copy/paste the code at the end of the php? I did that but it crashed my site. I had to go through the backend (siteground) to fix it. Any specific guidance on where to place this code is appreciated.
-
This reply was modified 5 years, 11 months ago by
kkirchem.
April 12, 2019 at 2:37 am #1089819 -
This topic was modified 5 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.