Youtube plugin resp...
 
Notifications
Clear all

Youtube plugin responsive

3 Posts
2 Users
1 Reactions
340 Views
(@rufus)
Posts: 2
New Member
Topic starter
 

Hi,

I use the plugin for Youtube and it doesn't seem to be responsive at all. Is there a way to fix this?

Thanks

 
Posted : February 28, 2023 12:04
Topic Tags
Editor
(@editor)
Posts: 553
Honorable Member Admin
 

Hi,

Add this to your theme's extra css form:

.video-container {
  position: relative;
  padding-bottom: 56.25%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

Then edit your youtube plugin

item_details.php

file to be like this:

 

<?php if( isset($detail['s_id']) && !empty($detail['s_id']) ) { ?>
<div class="video-container">
    <h2 style="margin-top: 10px;"><?php _e('Youtube video', 'youtube') ; ?></h2>
    <iframe type="text/html" src="https://www.youtube.com/embed/<?php echo $detail['s_id']; ?>" frameborder="0"></iframe>
</div>
<?php } ?>

Let me know if this working for you.

 
Posted : February 28, 2023 12:29
Rufus reacted
(@rufus)
Posts: 2
New Member
Topic starter
 

THANKS !!!

It works great and it was so easy to do.

 
Posted : February 28, 2023 13:08