Problems adding to query_vars
-
I am new to wordpress development and am getting very frustrated with this.
First, what I am trying to accomplish is this: I have a page template (and a published page) that has some form data (some dropdowns and a text field). I want to take these field values and query wp_usermeta to get a table with cetain meta_key / meta_value pairs…I am not using the info to get posts.
First I had a terrible time figuring out how to pass parameters to the results page at all, since having a submit button appends the Submit x and y values etc to the post.
Eventually after some trial and error and a lot of searching I found this: /www.rlmseo.com/blog
I did this, and now I’m closer but not there yet.
See adding a filter like
add_filter('query_vars', 'add_query_vars');
in my functions.php (in my theme) did not add the variables returned in the add_query_vars method to query_vars, at least by the time it got to my templated pages.Adding
add_filter('request', 'add_query_vars');
got it to show up sortof in the template…but instead of getting a query_var with a key= to my vars in add_query_vars with a value of the rewritten querystring parameter (if it existed) I get a key=0, 1 etc with a value equal to the vars returned in add_query_vars.I hope that makes sense. I can post additional code if that would be helpful. Any insights would be great…I have spent way to long trying to get a simple search working.
- The topic ‘Problems adding to query_vars’ is closed to new replies.