Strip Certain Tags From Feeds
-
Really just posting this here to see if this option will be available in future releases.
Im using googlenews RSS feeds with the WP RSS Multi Importer but when
I set “Check to get rid of all html and images in the excerpt” to NO
images dissapear and tables from the news feed dont make a mess of the theme layout, but I wanted to keep the images.So in wp-content/plugins/wp-rss-multi-importer/inc
excerpt_functions.php
I changed on Line 242:
$content=strip_tags(html_entity_decode($content));
to keep certain tags:
$content=strip_tags(html_entity_decode($content),'<font><a><img><p><br>');
And
On the function showexcerpt return
near Line 275 where the line
says:
return $content;
I replaced it with:
return preg_replace('/\<[\/]?(table|tbody|tr|td)([^\>]*)\>/i', '', $content);
to strip out the table tags but keep the images as the tables where making my theme layout a mess.
Hope this helps out someone if I had more time I would have added metaboxes for a few tag options in the plugins admin for others to use.
Great plugin thanks, and works well with my own custom_post_types.
- The topic ‘Strip Certain Tags From Feeds’ is closed to new replies.