Custom query var rewriting with only variable
Answered thanks to Milo’s comment. I wrote a small function to check if the query variable exists. Note that get_query_var(‘listen’) didn’t work for me. function is_listen() { $vars = $GLOBALS[‘wp_query’]->query_vars; if ( array_key_exists(‘listen’, $vars) ) { return true; } else { return false; } } Use it in a conditional like so: if ( is_listen() … Read more