WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add an all pages link to posts when I have ?all=1 at the end of the URL it's returning "not set", I'm not sure what I'm doing wrong. I've looked here and my code is the same as here: http://codex.wordpress.org/Custom_Queries#Custom_Archives


add_filter('query_vars', 'all_pages' );
function all_pages( $qvars ) {
$qvars[] = 'all';
return $qvars;


global $wp_query;
if (isset($wp_query->query_vars['all'])) {
    $remove_pagination = $wp_query->query_vars['all']; 
    echo "all set";

} else { echo "not set"; };
share|improve this question
When did you add the filter? On which hook? – kaiser Dec 17 '11 at 1:26
@kaiser I'm not exactly sure what you mean, I'm not a programmer, just stumbling through this. – kel Dec 17 '11 at 18:26
up vote 0 down vote accepted

My issue was with nginx, specifically:

location / {
   index index.php index.html;
   try_files $uri $uri/ /index.php;

Which I changed try_files $uri $uri/ /index.php; to try_files $uri $uri/ /index.php?$args; as outlined here which also fixed another issue that I was having with URL parameters.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.