In our earlier article, we confirmed you how to set oEmbed max width in WordPress 3.5 using $content_width. That could be a completely good resolution for altering the oEmbed max width and peak, however that change is world. In a current mission, we needed to have completely different oEmbed sizes for the homepage and the only publish web page. On this article, we'll present you how you can dynamically change the oEmbed max width and peak in WordPress utilizing the conditional statements.
All you must do is add the next perform in your theme’s capabilities.php file or in a site-specific plugin.
//Customized oEmbed Measurement
perform wpb_oembed_defaults($embed_size)
add_filter('embed_defaults', 'wpb_oembed_defaults');
You should use any of the out there WordPress conditional tags. You may even have the oEmbed width be customized for every web page if want be utilizing customized fields. Hopefully you can find this text helpful in your subsequent mission.