Define embedded media width

This is being used with custom post types to determine embedded media width, such as videos or iframes. Non-responsive. Add to functions.php

function define_content_width() {
 if ( is_post_type_archive( 'sounds' ) || is_home() || is_archive() || is_search() || is_tag() ) {
 global $content_width;
 $content_width = 225;
 }
 if ( is_singular( 'sounds' ) ) {
 global $content_width;
 $content_width = 594;
 }
}
add_action( 'template_redirect', 'define_content_width' );

Dave Winter focuses in WordPress UI Design and WordPress Plugin Development (some have labelled him a fanatic) but has hands in many other projects, including photography and music. He's never far from a computer... or an iPad (for testing purposes, of course). If you've been to a WordCamp in Southern California, he probably already knows who you are (or maybe not - he's terrible with names). Dave currently teaches courses at California State University, Long Beach alongside his small business at dauid.us (and his students think he's pretty boss).
© 2008-2020, dauid.us