Forums

[resolved] Custom query for custom feed (4 posts)

  1. scibuff
    Member
    Posted 2 years ago #

    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 to http://mysite.com/feed/responce everything works fine.

    Now, I would like to add a query parameter to such a request ... using the usual
    http://mysite.com/feed/responce/?param1=value1
    works just fine but I would like it to be
    http://mysite.com/feed/responce/param1/value1.

    basically I would like this to redirect to index.php?feed=responce&withcomments=1&param1=value1. I've looked into $wp_rewrite->rules and tried using

    'feed/responce/(.+)/(.+)' => 'index.php?feed=responce&withcomments=1&param1='.$wp_rewrite->preg_index(1)

    and many variations thereof but if I try to go to
    http://mysite.com/feed/responce/param1/value1
    it always redirects me to WP's 404 page.

    Any help would be appreciated, thx

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Have you looked over the info here?
    http://codex.wordpress.org/Function_Reference/WP_Rewrite

    I've not had a dig at using the WP rewrite rules myself, but that page seems to cover the crux of it.

    Does that help?

  3. scibuff
    Member
    Posted 2 years ago #

    yes, i did, that's what I'm basing this on ... but I'd need concrete help (example) how to make the overwrite work ... thx

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Another handy link.
    http://www.prodeveloper.org/create-your-own-rewrite-rules-in-wordpress.html

    Can't offer more then linked examples because i've not used the rewrite functions myself.

Topic Closed

This topic has been closed to new replies.

About this Topic