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 array_merge( $new, $rules ); // Ensure our rules come first
}
add_filter( 'rewrite_rules_array', 'so23698827_add_rewrite_rules' );

// for permalinks
function wpa_show_permalinks( $post_link, $post ){
    if ( is_object( $post ) && $post->post_type == 'songs' ){
        $terms = wp_get_object_terms( $post->ID, 'singer' );
        if( $terms ){
            return str_replace( '%singer%' , $terms[0]->slug , $post_link );
        }
        else{
           return str_replace( '%singer%/' , '' , $post_link ); 
        }
    }
    return $post_link;
}
add_filter( 'post_type_link', 'wpa_show_permalinks', 1, 3 );

Hope this is helps you 🙂