Support

Account

Home Forums Front-end Issues Relation to another post-type to display current post-types

Solving

Relation to another post-type to display current post-types

  • Hi,
    I have two post types:
    – companies
    – testimonials

    I have built a relation in companies entry and on testimonials entry, linking both.

    On a testimonial single post I need to display all relations of related company and the_content of the company.

    Do you have any idea how to solve that?

  • Hi @motyla,

    So you have linked your testimonials to their companies using the post object => http://www.advancedcustomfields.com/resources/field-types/post-object/

    Now you want to display the liked company details on the testimonial post?

  • That’s right. I have built a relation like herehttp://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/ but it seems not to work at all..

  • Hi @motyla

    It is important to notice that the post_object and relatinoship fields are different and return different data.

    Perhaps you could post the code you are using (please post a simplified version if possible) and we an take a look and point out any issues.

    Also, it is helpful to debug your code line by line. This means printing out teh variable on that line to check that it is as expected.

    Thanks
    E

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Relation to another post-type to display current post-types’ is closed to new replies.