WordPress looks for the $content_width
variable when determining the width of oEmbed items. To define this variable, you would put this in the functions.php
file:
if ( ! isset( $content_width ) ) $content_width = 600;
However this is kind of limiting especially since we can have multiple layouts in Genesis. So the Genesis team has made it easy to define different $content_widths
. For Genesis child themes, we would use this instead:
$content_width = apply_filters( 'content_width', 580, 480, 900 );
The 3 numbers correspond to the content width of the default, small and large layouts. The default layout refers to 2-column layouts; small refers to 3-column layouts and large refers to the full-width content layout.
You can combine this with the following method (borrowed from Twenty Twelve) to apply a different $content_width
to different contexts and page templates.
function twentytwelve_content_width() { if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } } add_action( 'template_redirect', 'twentytwelve_content_width' );
See also: Brad Dalton on How To Change Content Width For Media Embeds Conditionally