Can't access custom query vars (permalinks & nginx)
-
I’m working on a site with a custom post type for movies. This post type includes multiple taxonomies and custom fields by which I need to filter the query results.
So I made a filter form and registered my custom vars. In functions.php I have:
function extra_query_vars($vars) { array_push($vars, 'date_from', 'date_to'); return $vars; } add_filter('query_vars', 'extra_query_vars');
When I go to
/movie-entries/?date_from=2011-12-01&date_to=2011-12-31
and dovar_dump($wp_query)
my 2 custom vars aren’t present.If I go to
/movie-entries/page/2/?date_from=2011-12-01&date_to=2011-12-31
, the ‘paged’ value is present but my custom vars still aren’t there.So I’m assuming it has something to do with permalinks and my nginx configuration. I’d really appreciate some help here since rewrite rules are beyond me. So …
- I have permalinks turned on
- In nginx I’m rewriting urls with
location / { try_files $uri $uri/ index.php; }
- I’m not rewriting my custom vars. Should I do that?
Any help would be greatly appreciated.
- The topic ‘Can't access custom query vars (permalinks & nginx)’ is closed to new replies.