Questions tagged [query-variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
3answers
3k views

Pagination Doesn't Work

I created myfile.php with the following content: global $paged; if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); } else if ( get_query_var( 'page' ) ) { $paged = ...
1
vote
2answers
3k views

Custom Rewrite with Query vars

I have been stuck on this for hours and tried all these different methods but none seem to work. I've seen other threads with a similar problem but the solutions are not working for me. I'm hoping ...
0
votes
1answer
3k views

Rewrite Rule for Custom Page with Query Vars in URL

Background I have a a page called 'listen' with a custom template, which runs a custom wp_query that uses the 'show' variable in the URL. The following example works... example.com/listen/?show=...
3
votes
1answer
1k views

paginate_links ignore my format

I need the pagination liks to have the url, like: current_url?p-page=1 current_url?p-page=2 current_url?p-page=3 And so.. The reason I need this is because I have other params in the page. the ...
3
votes
2answers
2k views

add_rewrite_rule not working for page var

I have a page called mypage and a custom query var called mycustomvar, I am trying to rewrite the following url: http://example.com/index.php?name=mypage&mycustomvar=someword to http://example....
4
votes
1answer
510 views

Filtered query_vars becomes global. Why does this work?

For some reason that's not quite clear, when I add custom query_vars, they become available everywhere without the need of an accessor like global or get_query_var() // if your url contains the var ...
3
votes
1answer
299 views

Custom permalink with pagination

I have a custom post type called news and in order to distinguish current and old news posts I have a custom field where the client can mark a news post as 'archived'. So my permalink rewrite code ...
2
votes
1answer
94 views

WordPress query through Products variation stock [closed]

I have WooCommerce variable products and a filter which is filtering products based on variation attributes. I have variation attribute depth which has numeric value (from 1 to 20) and the filter is ...
1
vote
0answers
638 views

set_query_var doesn't seem to work on init hook

Based on the trick of using set_query_var with get_template_part to easily pass variables from one template file to another (see here: Method 3), I thought I could use the same method for passing ...
0
votes
0answers
33 views

use query var argument as verification link?

In a from response email I want to send a link to with a unique url string attached to it. Clicking that link and visiting the website through that link should trigger a function. The way I thought to ...