Rewrite rule not working, issue may be in URI request
I think you should do something like this: function my_rewrite_rule() { add_rewrite_rule(‘^prefix/section/([0-9]+)/([^/]*)?’, ‘index.php?section=$matches[1]&name=$matches[2]&post_type=post’, ‘top’); } add_action(‘init’, ‘my_rewrite_rule’); Add a query var for section: function my_query_vars( $vars ) { $vars[] = ‘section’; return $vars; } add_action( ‘query_vars’, ‘my_query_vars’ ); I created the pattern for your section (which can be 1 or 2) and used $matches[2] to … Read more