Viewing 2 replies - 1 through 2 (of 2 total)
  • All of the feeds are done via do_feed_* action hooks. For example, if someone requests a standard RSS feed, the do_feed_rss2 action hook is triggered, and because by default the identically named do_feed_rss2() function is the callback for the do_feed_rss2 action hook, do_feed_rss2() is called, and it loads the default RSS template (wp-includes/feed-rss2.php).

    What that means is that if you want to have a completely custom RSS template, you can use your own after removing the default, like so:

    // remove the default feed callback
    remove_action('do_feed_rss2', 'do_feed_rss2');
    
    // your function to load your custom template
    function helmi_rss( $for_comments ) {
    if ( $for_comments )
         load_template( ABSPATH . '/path-to-your-comments-feed.php' );
    else
         load_template( ABSPATH . '/path-to-your-standard-feed.php' );
    }
    
    // add the callback function to the action hook
    add_action('do_feed_rss2', 'helmi_rss');

    That’s just for RSS 2; you will probably want to customize the other feed types, too.

    Thread Starter helmi

    (@helmi)

    Hi filosofo,

    thanks for the hint. Ok i thought there’s probably a already built in templating-way to change feeds ‘a bit’.

    Thats way hard for a non-coder ?? I’ve to decide whether it’s worth it ??

    Best,
    Frank

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category dependent feed-layout’ is closed to new replies.