Skip to content

Instantly share code, notes, and snippets.

@LucaRosaldi
Created January 3, 2013 08:33
Show Gist options
  • Save LucaRosaldi/4441858 to your computer and use it in GitHub Desktop.
Save LucaRosaldi/4441858 to your computer and use it in GitHub Desktop.
WP: Change oEmbed Width and Height
<?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