Apologies if this has been answered - I have not been able to find a similar topic. I would like to set up the following loop and am hoping it is possible.
We have a custom post type called “User Profile” which contains ACFs.
Every user has the ability to create another custom post type called “Listings”.
I would like to create a loop to be displayed on the “User Profile” CPT which lists the “Listings” (pun unintended) the particular user has created.
I have gut feeling this is doable but I am unsure how to set it up or which loop type I should use. Thanks in advance.
Hello! How is the User Profile CPT associated with the Listings CPT? Is the user submitting the listing being set as the author? Is the User Profile CPT associated with the WP user in any way?
This should be possible, assuming you’ve got the right relationships set up, but it will be difficult to help without a bit more context about where the relationship information is coming from
Alright, so then the user authors a User Profile and potentially Multiple Listing pages. On the User Profile page, we want a loop of Listings created by the author of the current page. Here’s what I would do (remember to update the listing_cpt_slug with your actual post type slug):