Custom query for custom feed
-
Hey guys,
so I’ve created a new feed (named it “responce”) which is basically rss feed. I’ve added it using
add_feed('responce', 'my_fuction');
and when I go tohttps://mysite.com/feed/responce
everything works fine.Now, I would like to add a query parameter to such a request … using the usual
https://mysite.com/feed/responce/?param1=value1
works just fine but I would like it to be
https://mysite.com/feed/responce/param1/value1
.basically I would like this to redirect to
index.php?feed=responce&withcomments=1¶m1=value1
. I’ve looked into$wp_rewrite->rules
and tried using'feed/responce/(.+)/(.+)' => 'index.php?feed=responce&withcomments=1¶m1='.$wp_rewrite->preg_index(1)
and many variations thereof but if I try to go to
https://mysite.com/feed/responce/param1/value1
it always redirects me to WP’s 404 page.Any help would be appreciated, thx
- The topic ‘Custom query for custom feed’ is closed to new replies.