Query var removed after rewrite
Maybe you are not using the correct hooks nor the correct rewrite rule. You are rewriting to pagename, which is for pages. You should use name to get posts by slug. add_filter(‘query_vars’, ‘cyb_add_query_vars’); function cyb_add_query_vars( $vars) { $vars[] = “item”; return $vars; } add_action(‘init’,’cyb_add_rewrite_rules’); function cyb_add_rewrite_rules() { add_rewrite_rule( ”^shows/([^/]+)/([^/]+)/?$” , ‘index.php?post_type=shows&name=$matches[1]&item=$matches[2]’ , ‘top’ ); } … Read more