• kgagne

    (@kgagne)


    I used Jetpack to apply some custom CSS to the Twenty Seventeen theme to move the sidebar and expand the main body’s width. However, YouTube videos were still oEmbedding at the default width of 525 pixels. So I created a child theme and added this line to the functions.php file:

    if ( ! isset( $content_width ) ) $content_width = 900;

    But that didn’t work. The only thing that did was changing line 59 in the parent theme’s function.php:

    $GLOBALS['content_width'] = 900;

    Of course, that defeats the entire point of having a child theme. What’s the proper way to accomplish what I’m trying to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • salsaturation

    (@salsaturation)

    Hi kgagne

    Did you try something like this in your child theme functions.php?

    if ( ! isset( $content_width ) ) {
    	$content_width = 900;
    }
    Thread Starter kgagne

    (@kgagne)

    Hi, Sal — thanks for the suggestion. Except for the curly braces, that’s the same code I posted in my original message. Just to be sure, though, I did try it again, and it still didn’t work. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Defining content width’ is closed to new replies.