Use URI suffix as parameter and ignore when resolving page

@Aboelabbas gave me the hint I needed. Although I don’t really know what I did different, here is the working code for all three modes I need: <?php add_filter(‘query_vars’, function ($query_vars) { $query_vars[] = ‘mode’; return $query_vars; }); add_action(‘init’, function () { add_rewrite_rule( ‘(.+)/buchung$’, // Rule for URLs ending with “/buchung” ‘index.php?pagename=$matches[1]&mode=booking’, ‘top’ ); add_rewrite_rule( … Read more

Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination

// change in post type argument register_post_type( “rewrite” => [ “slug” => “songs/%singer%”, //change in taxonomy argument “with_front” => true ]); register_taxonomy( ‘rewrite’ =>false’, ‘with_front’ => true, ‘query_var’ => true, ‘Custom Rewrite Slug’ => ”); // for add rewrite rule function so23698827_add_rewrite_rules( $rules ) { $new = array(); $new[‘songs/([^/]+)/(.+)/?$’] = ‘index.php?songs=$matches[2]’; $new[‘songs/(.+)/?$’] = ‘index.php?singer=$matches[1]’; return … Read more