• hello, my site is streetillustrated.com which is using worldwide theme.
    my theme was working correctly till yesterday. but from today suddenly the top video in my home page has become wide, and because of that extra space is created for remaining contents in the page. I’m guessing it has to do with the css.
    can anyone help me with this problem
    thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Add this code to style.css in your child theme, or install this plugin and insert into it’s code editor in the WordPress admin area.

    .single-page iframe{
      height: 364px;
    }

    This is a really quick and easy fix and the video will be a bit tall on mobile devices.

    If you want, here’s a javascript solution. This will resize all iframes though and is only appropriate for video dimensions. If you have other types of iframes on your site it will make them weird sizes.

    function resizeIframe(selector){
    	var iframe = $(selector);
    	var w = iframe.parent().width();
    	var h = w * 0.5625;
    	iframe.attr('width', w);
    	iframe.attr('height', h);
    }
    
    jQuery(document).ready(function(){
            resizeIframe('iframe');
    });

    You can paste this code into a plugin that allows you to add javascript, or into a javascript file if you’re good with that sort of thing.

    Myles
    https://mylesenglish.com

    Thread Starter nikhilcb

    (@nikhilcb)

    hello, the 1st css code solved the problem, although the video appears bit height, but its ok.
    Thank you @bijingus

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Width error in my mobile theme’ is closed to new replies.