Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Specifically I would like to change the value of <dc:creator> in the feed items. In order to display the site name instead of the post author.

I'm able to hook into the_title_rss , the_excerpt_rss and the_content_feed, but can't find how to change the header elements of a feed item.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

this value comes from the template tag the_author(). You can also filter this. But it is important, that you check, that the filter only work on the feeds; see the follow example at the check for is_feed(). After this i change the autor name only, if the string has the value 'name_xyz'; here is the point that you change your data from your requirements.

I write from scratch, don't tested!

add_filter( 'the_author', 'fb_change_fead_creator', 10 );
function fb_change_fead_creator( $text ) {

    if ( ! is_feed() )
        return;

    if ( 'name_xyz' == $text )  
        $text = 'my new name';

    return $text;
}

Best

share|improve this answer
    
Great, that works! I guess the same logic can be applied if you want to change the date, hook into the_date –  mike23 Apr 19 '12 at 12:39
    
Yes, same logic –  bueltge Apr 21 '12 at 5:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.