How to use a capture from a rewrite rule inside a php file (like single.php)?
Nicolais Tip got me on the right track; Here is the working code: // add a query_var first add_filter(“query_vars”, function($vars) { $vars[] = “myTheme_podcast_time”; return $vars; }); add_filter(“rewrite_rules_array”, function($rules) { $newRules = array(); $newRules[“(.*)/time/([\d|\:]+)s?$”] = ‘index.php?name=$matches[1]&myTheme_podcast_time=$matches[2]’; $merged = array_merge($newRules, $rules); return $merged; }); And then in single.php: $time = get_query_var(“myTheme_podcast_time”); // do stuff