Since a couple of weeks I’m trying to create my own rewritings on pages. I read a lot about rewriting with posts and custom post-types.
BUT: I have pages that I call with variables. How is it possible to bring these variables into a permalink-structure?
Currently, I have:
www.mysite.com/pagename/?arg1=value1&arg2=value2
but I want to have something like
www.mysite.com/pagename/value1/value2
I have fount the hook post_link which seems to be used on pages and page_link for pages. But page_link doesn’t work in the same way. How can I do, what I want to do?
Please help!
Yes this is possible using the $wp->add_query_var function used together with add_rewrite_rule .
Here you have an example:
Passing and retrieving query vars in wordpress
If you want more help here is a cut from one of my old plugins: