-
AuthorPosts
-
May 14, 2018 at 11:34 am #956371
Hi
Since the latest update to Enfold 4.3.1 Youtube videos linked in the image element are not opened in a ligthbox anymore. If I click on the image, a youtube page opens in the same tab. See here: https://www.runmyaccounts.ch/videos/
Can you please help to open the lightbox again?
Thanks and best regards
ThomasMay 14, 2018 at 11:44 am #956374if you haven’t changed link it makes me wonder that it has opend before in a lightbox
add behind your youtube link add ?iframe=true f.e.:https://youtu.be/YEmI2MDpasE?iframe=true
if you have more options like me it is with &iframe=true
i would prefer links with many options to avoid related videos at the end ; related videos on pause etc.
the nocookie is nice to have because of new GDPR (DSGVO on german spoken countries)https://www.youtube-nocookie.com/embed/<strong>ID</strong>?enablejsapi=1&ecver=2&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3&iframe=true
May 14, 2018 at 12:21 pm #956390i see you got on this page a lot of videos.
so if you are working with a child theme – and if you are not willing to do this by hand
– do this to functions.php of your child-theme:function add_lightbox_option(){ if(is_page(21397)){ ?> <script> (function($){ $('a[href*="you"]').each(function(){ this.href += '?iframe=true'; }); })(jQuery); </script> <?php } } add_action('wp_footer', 'add_lightbox_option');
if this does not work – than our jquery is a bit too old – and we have to find a different way.
- This reply was modified 6 years, 6 months ago by Guenni007.
May 15, 2018 at 12:22 am #956754Hi Guenni007
Thanks for your answer. Unfortunately adding ?iframe=true does not help. See the first video on the page https://www.runmyaccounts.ch/videos/. I thought it could have something to to with the new handling of css and js in the current release.
Best regards
ThomasMay 15, 2018 at 8:01 am #956837do you have a custom header.php file in your child theme?
The first 27 lines in header.php have completely changed. So if you go with a child-theme version you have to renew your adjustments there and place a new one.And maybe another test : don’t know if thes you.tu links are wellcome use :
https://www.youtube.com/watch?v=YEmI2MDpasE?enablejsapi=1&autoplay=1&ecver=2&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3&iframe=true
see here with your video ( i just made the modal window bigger for my use) :
https://webers-testseite.de/videos-on-lightbox/May 15, 2018 at 4:50 pm #957087Dear Guenni007
Thank you very much for this suggestion. Changing the first few lines of the header.php file of the child theme has fixed the issue!
Best regards
ThomasMay 15, 2018 at 7:02 pm #957181gut – aber denke mal darüber nach ob du nicht diesen Rattenschwanz da immer dran basteln solltest.
Denn wenn du das Video jetzt startest, und dann pausierst, dann siehst Du was ich mit Werbung meine ( das wird mit dem ecver=2 verhindert.) und am ende die related Videos mit dem rel=0 etc. pp.
Ausserdem ist die Nocookie Variante jetzt ohnehin besser wegen der DSGVO ( GDPR )May 15, 2018 at 9:07 pm #957223Vielen Dank für die Tipps! Werden wir ausprobieren!
May 16, 2018 at 10:34 pm #957775do this to your functions.php of your child-theme and all links got that addendum:
function add_to_youtube_videos(){ if(is_page(21397)){ ?> <script> (function($){ $('.lightbox-added[href*="www.you"]').each(function() { var $this = $(this); var _href = $this.attr("href"); $this.attr("href", _href + '?enablejsapi=1&ecver=2&autoplay=1&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3'); }); })(jQuery); </script> <?php } } add_action('wp_footer', 'add_to_youtube_videos');
May 16, 2018 at 11:06 pm #957821Thank you very much! We will try this out.
Best regards
ThomasMay 18, 2018 at 7:19 pm #958787by the way – you have to use the script to make it easier for you .
If you want to test these settings :
1) the first parameter after a youtube link ( after the ID) has a questionmark ?
2) all following parameters have to be added by a &so it is :
https://www.youtube-nocookie.com/watch?v=YEmI2MDpasE?ecver=2&rel=0
May 18, 2018 at 8:13 pm #958807Thank you, we will try this!
Best regards, Thomas
July 18, 2018 at 8:01 am #986822Hi, I have a problem and can not use the lightbox on own template pages and in the products.
I used the Shortcode:
<?php echo do_shortcode("[av_image src='https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg' attachment='316' attachment_size='large' align='center' hover='' link='lightbox' target='' caption='' font_size='' appearance='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' animation='animation' ][/av_image]"); ?>
or tried it with copying the code out of the html
<div class="avia-image-overlay-wrap"><a href="https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg" class="avia_image lightbox-added"><img class="avia_image " src="https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg" alt="2015 supermodell des jahres" title="" itemprop="thumbnailUrl"><span class="image-overlay overlay-type-image" style="left: -5px; top: 0px; overflow: hidden; display: block; height: 800px; width: 610px;"><span class="image-overlay-inside"></span></span></a></div>
But there is no results:
July 18, 2018 at 9:03 am #986841have you a link where this does not work – or where you want that to work.
July 18, 2018 at 9:06 am #986842Hi yes it is here the Award image right below: Here i tried various possibilities
And in my own template:
July 18, 2018 at 9:22 am #986847first of all – do you have a custom header.php in your child-theme?
July 18, 2018 at 9:25 am #986849Hi Guenni,
no its all relatively basic – here it is working: https://www.cmc-modell-autos.de/contact/
But when I copy the shortcode in the product template or in the masonry it is not working anymore?July 18, 2018 at 11:48 am #986906but best would be if you open a new topic here on board. Your problem is not realy concerning to this thread here.
July 20, 2018 at 3:05 pm #987870Hi!
We’ll close this thread now.
// https://kriesi.at/support/topic/can-not-use-the-lightbox-in-images-on-own-template-2/#post-987446
Best regards,
Ismael -
AuthorPosts
- The topic ‘Open Youtube videos in lightbox’ is closed to new replies.