Getting the category of Custom Posts in a Post loop

Hi everyone,
I’m Francesco and I’m new to the forum.
Maybe this is a simple task but I can’t find the solution that I want.
I have a loop that goes through some custom posts with categories assigned to them, something like this:

<Loop type=project>
   <div class="grid__el {'I want the post category here'}">
      <Field name="project_name" />
    </div>
</Loop>

I’m trying with a taxonomy loop inside a post loop but posts with more than 1 category will be displayed more than 1 time.

What can I do?

Maybe you can try this. It will output the categories of the posts

<Loop type=post>
 <div class="grid__el {Loop taxonomy=category post=current}{Field name}{If not last} {If}{Loop}">
    <Field title />
  </div>
</Loop>

This will only output 1 taxonomy term

<Loop type=post>
 <div class="grid__el {Loop taxonomy=category post=current count=1}{Field name}{If not last} {If}{Loop}">
    <Field title />
  </div>
</Loop>

Thanks! In the end I’ve used another method but I will try this next time.