php - Query string is empty always in wordpress -


I want to hide some content on the wp page, for example depending on the query string

 < Code> site / article / name /? Nosidebar = 1   

I use $ _GET ['nosidebar'] to view the property value. It works on the local server, but the $ _GET array is empty all time on the remote server. I tried to add custom code to the public properties via the following code: $ global ['wp '] - & gt; Add_query_var ('nobsidebar');

But still the idea of ​​what a get_query_var ( 'nosidebar') and $ _GET [ 'nosidebar'] still nothing to return to why this happens and how do I solve it Can i

You can use the add_query_arg simple () function in WordPress

example To:

  & lt ;? Php add_query_arg ('foo', 'bar'); ? & Gt;   

The above code will detect some links

  output / client /? S = word & amp; To get the variable back to foo = bar '  

, use another WordPress function

  & lt ;? Php $ variable = get_query_var ('foo'); ? & Gt;   

In the above case the value of $ variable will be 'bar'

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -