Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

functions.php

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

single.php

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.