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.

Currently the RSS feed of my WordPress blog gives me the latest published posts. Is it possible to change this so that it returns the ones that are latest updated instead? So that the latest published are still in the feed, but if I update an old post it would pop up in a feed reader.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try this (not tested) add to your functions.php of active Theme

function wpse49312_alter_the_query( $request ) {
    $dummy_query = new WP_Query();
    $dummy_query->parse_query( $request );

    if ( $dummy_query->is_feed() )
        $request['orderby'] = 'modified';

    return $request;
}
add_filter( 'request', 'wpse49312_alter_the_query' );

From Alternative to query_posts for main loop?

share|improve this answer
    
Tested. Works fine :) –  user15194 Apr 17 '12 at 16:06
    
Cool! Will test it out on my blog. Is there any special meaning to wpse49312? –  Svish Apr 19 '12 at 7:33
    
Added it to my functions.php file now, but doesn't seem to change the order of the feed? As far as I can see anyways... :/ –  Svish Apr 19 '12 at 8:57
    
Actually, seems like it does! –  Svish Sep 26 '12 at 7:25

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.