wp rewrite and custom RSS feed
-
I created a custom feed template “testfeed” which I want to use for categories e.g.: https://www.test.com/category-1/testfeed
The problem I have is with wp_rewrite, I cant get it working:
function custom_feed_rewrite($wp_rewrite) { global $wp_rewrite; $feed_rules = array( 'testfeed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; return $wp_rewrite; } add_filter('generate_rewrite_rules', 'custom_feed_rewrite');
This works https://www.test.com/category-1/?feed=testfeed but I want to have nice URL’s.
Any help would be appreciated.
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp rewrite and custom RSS feed’ is closed to new replies.