Assuming that you have a CPT with slug projets
and you’ve registered built-in categories for that CPT, it all looks correct.
So there are two possibilities, that I would check:
- Typos – maybe you misstyped your CPT name somewhere in your code.
pre_get_posts
filter is modifying your query and changing its behavior (it’s pretty common if you writepre_get_posts
and don’t pay enough attention to conditions inside of it).