0

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
  • 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
0

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');
  • 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
0

The problem is solved.

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

  • Where do you re-save your permalink settings? – Kimberly W Oct 20 '16 at 16:09
  • You just go to Settings > Permalinks. When you visit that page WordPress automatically refreshes all permalinks. – Gavin May 14 '17 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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