Title: Simplepie plugin processing resize video
Last modified: August 19, 2016

---

# Simplepie plugin processing resize video

 *  [onigetoc](https://wordpress.org/support/users/onigetoc/)
 * (@onigetoc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/simplepie-plugin-processing-resize-video/)
 * I use the blog style full option and i wanted to resize the video in the rss 
   feed a load. I write a php code to resize all videos to fit my WordPress template,
   some was just to big or to small.
    here the code
 *     ```
       <?php
   
       /**
        * EMBED RESIZING
        *
        * This will let you resize all videos in a rss feed.
        *
        * If you don't want to do anything to the content, simply remove the function.
        */
   
       // We MUST keep this classname.
       class SimplePie_PostProcess
       {
       	// Function name MUST be the same as the template tag we're processing, all lowercase, and MUST accept a single string parameter.
       	function item_content($s)
       	{
       		// Match all images in the content.
       		// I would recommend the regex tool at http://osteele.com/tools/rework/ to do testing ahead of time.
       		if (preg_match('#(<(object)(.+?)</object>)#is',$s,$matches)) {
   
       		$embedcode = $matches[1];
       		$embedcode = str_replace("\\", "", $embedcode);
       		$embedcode = preg_replace('/width=(\'|\")(.*?)(\'|\")/', 'width="550"', $embedcode); #385
       		$embedcode = preg_replace('/height=(\'|\")(.*?)(\'|\")/', 'height="400"', $embedcode); #300
       		$s = preg_replace('#(<(object)(.+?)</object>)#is', $embedcode, $s);
       		}
   
       		// Return $s back out to the plugin.
       		return $s;
       	}
       }
   
       ?>
       ```
   
 * i called this file embed.php and put it in the simplepie-plugin-for-wordpress
   plugin folder. You can choose the option in the simplepie admin section Content“
   Post-Processing Rules:”

The topic ‘Simplepie plugin processing resize video’ is closed to new replies.

## Tags

 * [simplepie](https://wordpress.org/support/topic-tag/simplepie/)

 * 0 replies
 * 1 participant
 * Last reply from: [onigetoc](https://wordpress.org/support/users/onigetoc/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/simplepie-plugin-processing-resize-video/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
