Modify feed content (5 posts)

  1. wesg
    Posted 8 years ago #

    I've just started to get into writing plugins, and I have an idea for one that involves modifying feed data before it is printed. Currently it works properly with the real posts, but I can't make it work with feeds. The whole premise of the plugin is to work with FeedBurner, but I can't even get it to work with the actual wordpress feed (which I believe FB taps into).

    The filter for the post itself is add_filter('the_content', PLUGIN-NAME);
    When I tried add_filter('the_content_rss', PLUGIN-NAME); it doesn't seem to modify anything.

    Any suggestions?

  2. Pinoy.ca
    Posted 8 years ago #

    Is your feed only publishing excerpts, not the content? Do you have other feed plugins active?

  3. wesg
    Posted 8 years ago #

    Turns out that FeedBurner must use a cache system or something. I left it as the_content and now it's good.

  4. petervcook
    Posted 8 years ago #

    I have the reverse question. I have a plug-in that shouldn't be applied to RSS feeds but only to regular queries. I am using add_filter('the_content') currently.

  5. Chris_K
    Posted 8 years ago #

    you could use the is_feed function for that (find documentation here).

    For example:

    function st_myFunc ($content) {
       if ( is_feed() ) return $content;
       // do stuff
       return ($content);

    I'm sure there are better ways :-) But that worked for me...

Topic Closed

This topic has been closed to new replies.

About this Topic