Permalink for CPT without archive but including taxonomy returns 404 on all other pages and posts

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

I’m trying to achieve the following permalink structure for a Diensten custom post type:
https://domain.com/%taxonomy%/%postname%/

With the code below I’ve achieved the desired permalink structure however it returns a 404 on all other posts and pages…

It has something to do with the fo_diensten_permalink function as it seems to target all posts and pages and not just the diensten custom post type. According to this link https://shibashake.com/wordpress-theme/custom-post-type-permalinks-part-2#conflict it can be resolved by adding a unique slug into the permalink structure. However when I do that it breaks the custom post type permalink structure. On the other hand, it solves the issue with the 404 for the other pages and posts.

This is the code that I’m using to register the Diensten post type:

Registering the Type diensten taxonomy’

The rewrite function

Any help is much appreciated.

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com