• Whenever I add the code to my functions.php the site quits working entirely any idea why? I am using the customizr theme but I dont think that matters.

    Functions.php

    add_filter('embed_oembed_html', 'my_embed_oembed_html', 99, 4);
    function my_embed_oembed_html($html, $url, $attr, $post_id) {
      return '<div class="video-container">' . $html . '</div>';
    }

    Style.CSS

    .video-container {
    	position: relative;
    	padding-bottom: 56.25%;
    	padding-top: 30px;
    	height: 0;
    	overflow: hidden;
    }
    
    .video-container iframe,
    .video-container object,
    .video-container embed {
    	position: absolute;
    	top: 0;
    	left: 0;
    	width: 100%;
    	height: 100%;
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Make sure that you are not having two functions with same name in functions.php.

    If you are writing custom function then best practice is to prefix your function name with your initial, company name, project name or anything that is fine with you. This will ensure that no two functions has same name.

    Hope this works for you.

    Cheers ??

    Tejas

    Thread Starter badincite

    (@badincite)

    Nope did a search no functions with the same name

    Thread Starter badincite

    (@badincite)

    It seems to be a issue with in the customizr template Ill see i can get some support from them

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding a Wrapping Div to Video Embeds’ is closed to new replies.