Title: Category dependent feed-layout
Last modified: August 19, 2016

---

# Category dependent feed-layout

 *  [helmi](https://wordpress.org/support/users/helmi/)
 * (@helmi)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/category-dependent-feed-layout/)
 * Hi,
 * i’d like to modify what is in the feed in general and depending on the category
   the post is in.
 * Does anyone have a clue if there’s a way to have a rss-template or something?
   There was a hack some time ago which is still linked in the codex ([http://wordpress.org/support/topic/25905](http://wordpress.org/support/topic/25905)
   linked here [http://codex.wordpress.org/Customizing_Feeds](http://codex.wordpress.org/Customizing_Feeds))
   but that doesn’t work for a long time.
 * I need to inlcude custom fields content in the feed but only on special categories.
 * Thanks for helping!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Austin Matzko](https://wordpress.org/support/users/filosofo/)
 * (@filosofo)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/category-dependent-feed-layout/#post-728770)
 * All of the feeds are done via `do_feed_*` [action hooks](http://codex.wordpress.org/Plugin_API).
   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](https://wordpress.org/support/users/helmi/)
 * (@helmi)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/category-dependent-feed-layout/#post-729026)
 * 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.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [helmi](https://wordpress.org/support/users/helmi/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/category-dependent-feed-layout/#post-729026)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
