SHARE
TWEET

Modify oembed Tweet width

jan_dembowski Jun 14th, 2012 273 Never
  1. <?php
  2. add_filter('oembed_result','twitter_no_width',10,3);
  3. // add_filter('embed_oembed_html','twitter_no_width',10,3);
  4. function twitter_no_width($html, $url, $args) {
  5.         if (false !== strpos($url, 'twitter.com')) {
  6.                 $html = str_replace('width="550"','width="200"',$html);
  7.         }
  8.         return $html;
  9. }
RAW Paste Data
Top