Support » Fixing WordPress » Youtube Embed Size not working

  • Hey all,

    I am trying to get every embeded youtube to be exactly 640×340
    but i can only get it to be 640 width then the height does its own thing.

    in functions.php i have used the following code

    if ( ! isset( $content_width ) ) $content_width = 640;
    if ( ! isset( $content_height ) ) $content_height = 340;

    only the top line depicting the width works.

    alternativly i tried this code

    function mycustom_embed_defaults($embed_size){
        $embed_size['width'] = 640;
        $embed_size['height'] = 340;
        return $embed_size;
    add_filter('embed_defaults', 'mycustom_embed_defaults');

    But this one even ignores the width and seems to do something in between.

    So how can i get my youtube videos to be exactly 640×340 through functions.php?

  • The topic ‘Youtube Embed Size not working’ is closed to new replies.