Quote:
Originally Posted by cyberxxx
Is that a problem? I don't think you will need such a feature provided by sponsor feeds. Here is a small and simple WordPress plugin which solves all your problems:
Code:
<?php
/*
Plugin Name: Remove Tags
Author: CyberXXX (ICQ: 166-924-423)
Author URI: http://www.morphingfeeds.com/
Plugin URI: http://www.thesponsorfeeds.com/
Description: Strips all the tags (e.g. <img>..</img>) excepting the specified ones (note below) from your blog posts.
*/
// Specify all the ALLOWED html here:
define ('ALLOWED_TAGS', "<a><br><p><b><strong><table><td><tr><ul><li>");
function remove_targs($content) {
return strip_tags($content, ALLOWED_TAGS);
}
add_filter('the_content', 'remove_targs', 20002);
?>
Copy the code above. Save it as "removetags.php", upload into your /plugins FTP folder and activate it from the WordPress control panel (yourblog.com//wp-admin/plugins.php). That's it!
Now ALL the posts on your blog will be displayed without images. Isn't that the easiest possible solution?
P.S. It's not just removes all the images from your blog posts, but also unifies them because it removes various <class>, <font> etc tags thank could make the posts look weird on various blog templates. However, you can add those tags into define line to make them allowed.
|
thanks for the tip! I might use it in the future, but actually what I do is pretty ghetto.... I keep my sponsor feeds and original posts separated on different blogs, so on blogs with sponsor feeds I use CSS to make all IMG tags hidden... so I still download them, and they are in the blog post code, but they aren't shown.
this way, in case 2257 changes in the future or somehow I'll be okay to display the images, I can just turn IMG tags back on in CSS.
might be a good solution for others out there too
