// Register custom post type function create_post_type() { register_post_type( 'custom_news', array( 'labels' => array( 'name' => __( 'News' ), 'singular_name' => __( 'News' ) ), 'public' => true, 'has_archive' => true, 'exclude_from_search' => false, 'supports' => array('title', 'editor', 'revisions', 'author', 'excerpt', 'thumbnail'), 'rewrite' => array('slug' => 'news', 'with_front' => 'false') ) ); } add_action( 'init', 'create_post_type' ); // Create custom feed from template function create_newsfeed() { load_template( TEMPLATEPATH . '/news-feed.php'); } // Replace default feed rewrite rules function customise_feed_rules($rules) { // Remove all feed related rules $filtered_rules = array_filter($rules, function($rule) { return !preg_match("/feed/i", $rule); }); // Add the rule(s) for your custom feed(s) $new_rules = array( 'feed/newsfeed' => 'index.php?feed=newsfeed' ); return $new_rules + $filtered_rules; } // Add the custom feed and update rewrite rules function add_newsfeed() { global $wp_rewrite; add_action('do_feed_newsfeed', 'create_newsfeed', 10, 1); add_filter('rewrite_rules_array','customise_feed_rules'); $wp_rewrite->flush_rules(); } add_action('init', 'add_newsfeed');