Help with CPT and ACF

He there,
I’m attempting to create a site that contains a PERSON custom post type and a PUBLICATION custom post type. PUBLICATION post types need to be related to one or multiple PERSONS.

On the front end, I want a custom post archive that lists people. I want to be able to list and sort based on custom category.

On the single-post page for PERSON, I would like to list details about the person, and list the PUBLICATIONS associated with that PERSON.

The PUBLICATION list on each PERSON’s single post page should be clickable and link to a single-post for the PUBLICATION custom post type.

I’d like the publications and person to be editable by each website user when logged in. In order to allow for this, I’ve made each PERSON profile authored by the associated WordPress USER.

I have created both custom post types and ACF fields for each post type. I have created archive and single post page for PERSON. I have also created the single-post page for the PUBLICATIONS.

Items where I need some guidance:

  1. I have created a PERSON archive, but would like to know to add a drop down menu (or other method) to be able to sort the users by PERSON category on the front end.

  2. I successfully created a relationship between the two different custom post types, and I can post the publications on the PERSON single post page, but it does not list any details. It only lists the post ID number(s). I need to be able to post the PUBPLICATIONS relevant for each PERSON as a linkable title that will link to the PUBLICATION single-post-page.

I’m also wondering if this is the best approach to this problem. It would be great to have the “person” be the WordPress USER and just add some ACF fields instead of a using a custom post type for PERSON, but it seems like there are more options available to publish the custom post type than to publish a USER archive. This also seems to be true based on needing custom taxonomy to organize the people.

Look forward to any hints you can provide the help me out!

Thanks in advance.

Hey @morpheus,

  1. For the filtering, set it up like in this video tutorial: https://youtu.be/611IwxrOz8E
  2. To list the details of the publication, try nesting repeaters like in this video tutorial: https://youtu.be/ncnXpRW4G_M

I believe it would be simpler if you use the WordPress User / Author setup rather than ACF. But, it would actually be best to try both to see what’s better for you.

Hope that helps.

OK, thanks for that. I’ve changed how I’m approaching the data design.

So now i have one Custom Post Type called PERSON, and I’ve created a repeater field containing multiple fields which contain the information about each Publication.

I’m having an issue getting anything in a repeater field to display in the loopers. I’m assuming i’m not setting up the loopers properly.

Hey @morpheus,

Would you mind sharing your admin credentials so that we can check on your setup properly? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password
  • Page URL or Layout Builder name

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hi, Thanks for looking,

I added a specific page url to the note.

Hey @morpheus,

I don’t see any code to get the repeater data. That being said, I created a new section at the bottom of the layout to show to you how to get the data.

It was based on this documentation.

And to access the users data, please watch the video suggested by the colleague.

Hope that helps.

Thankyou, this has been very helpful and I’ve used this in my site.

I’m wondering though, what is required to show a repeater field with two or more columns?

In my example, each person has multiple ways to contact them. Each method is not the same.

So, i created a repeater field called “Contacts”. Within this there are two repeated text fields. “Contact_type” and “Contact_information”.

This was done because some people have multiple phone numbers for multiple locations.

for example, Person-A will have: Office B3434 Phone Number , Field Office 343 Phone number, email, twitter
Person-B will have: Direct phone, email,

As you can see, each contact type has a different office number or type of contact.

I am trying to list each contact type (office B-2343 phone, twitter) for the respective person in one column and then the actual contact information in a second column (the phone number, email address, twitter handle, etc.)

Hey @morpheus,

I suspect you are referring to Nesting the Repeater field, if that’s the case, you need to check these resources.

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.