Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] auto-embed with in stream

  • @wh82

    Participant

    Hi,

    I embedded a YouTube video by just posting the URL in my bp stream.

    To adjust the width I added the following to my functions.php:

    
    if ( ! isset( $content_width ) )
        // Change 640 to whatever the width of your column is
         $content_width = 358;
    

    The problem is: on mobile devices, the with is still 358px, and changing 358 to 100% doesn’t work… anyone know how to solve this?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant

    Have you tried to adjust the size via child theme’s CSS ?
    Some examples here: https://en.support.wordpress.com/custom-design/custom-css-media-queries/

    @r-a-y

    Keymaster

    You could try redefining $content_width if a mobile device is on your site.

    Maybe something like:

    if ( wp_is_mobile() ) {
        $GLOBALS['content_width'] = 100; // change 100 to whatever your value should be. this shouldn't be a percentage value.
    }

    This is probably too generic though.

    danbp’s idea of using CSS media queries is probably better. Or consider using a JS script like fluidvids to accomplish what you need.

    @wh82

    Participant

    Thanks, the iframely.com plugin did the job for me

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] auto-embed with in stream’ is closed to new replies.
Skip to toolbar