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've a problem. I've tried a lot of things but I could not find a solution. I use query_vars parameters in this page and there isn't any problem. But i don't use different parameters or the same parameters in different custom page (../videolar). Parameter value is always empty. Parameters used once ? Function.php :

function parameter($qvars){ 
     $qvars[] = 'kategori';
     $qvars[] = 'ara';
     $qvars[] = 'numara';
     $qvars[] = 'tur';
     return $qvars;
}
add_filter('query_vars', 'parameter');

videolar.php (../videolar?tur=test) :

global $wp_query;
echo $wp_query->query_vars['tur'] // empty
share|improve this question
    
Could you rephrase: "But i don't use different parameters or the same parameters in different custom page (../videolar)." I don't understand what you mean. –  helgatheviking Feb 27 '13 at 17:51
add comment

2 Answers 2

As best as I can understand, you are looking to echo out the value of a query variable. The WordPress function for getting a query variable is get_query_var().

So in your videolar.php template you would add:

echo get_query_var('tur');
share|improve this answer
    
i've tried this, value is still empty. –  etg Feb 28 '13 at 8:27
    
Hmm.... well then I would disable all your plugins and maybe switch to the default theme to try to isolate the problem. What you are doing looks right to me. Sorry I can't be more helpful! –  helgatheviking Feb 28 '13 at 13:21
add comment
up vote 0 down vote accepted

The problem is solved.

Re-save your permalink settings after you add the parameter. Or change the file permissions of .htaccess to 777.

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.