Created
January 3, 2013 08:33
-
-
Save LucaRosaldi/4441858 to your computer and use it in GitHub Desktop.
WP: Change oEmbed Width and Height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Changes oEmbed defaults dinamically | |
*/ | |
function lr_oembed_defaults($embed_size) { | |
if(is_front_page()) { | |
$embed_size['width'] = 940; | |
$embed_size['height'] = 600; | |
} | |
else { | |
$embed_size['width'] = 600; | |
$embed_size['height'] = 338; | |
} | |
return $embed_size; | |
} | |
add_filter('embed_defaults', 'lr_oembed_defaults'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment