Skip Navigation

[Resolved] Need to display post title with link for a CPT linked via ACF relationship

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 3 voices.

Last updated by Matthew Helmick 7 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#563029
product-list-view3.png
product-list-view2.png
product-list-view1.png
material-list.png

Tell us what you are trying to do?

I have a CPT "Curriculum" (not built with Types) that has a relationship with WooCommerce Products. The relationship is defined with the ACF Relationship field. I need to show the "Post Link + Post Title" for the related Curriculum from a Toolset View. I'm very close and I can pull up the associated Curriculum IDs via a Toolset View but I cannot get it to display "Post Link + Post Title" for the associated Curriculum Posts.

In the attached graphic "Material-List.png" you can see the view. The column that says "Associated Units/Lessons" is accurately pulling in the IDs for the associated Curriculum CPTs. These are sometimes more than one.

The Product List Loop Item is as follows and [wpv-post-field name='associated_posts'] is the field capturing the associated post IDs, but it isn't looping to get each one in the array (or comma-separated values like "397,402"). I'm not sure how or if I can create such an inner loop to capture the "Post Link + Post Title":

<td>[wpv-post-title]</td>
<td>[types field='for-1-bin' output='raw'][/types]</td>
<td>
[wpv-post-field name='associated_posts']
</td>
<td>[wpv-post-taxonomy type="product_cat"]</td>
<td>[wpv-woo-buy-or-select]</td>

I was able to capture the first Post Link + Title by doing the following, but it wouldn't loop to the second:

[wpv-post-link id="[wpv-post-field name='associated_posts']"]

Is there a way to loop through the values in [wpv-post-field name='associated_posts'] and output them as Post Link + Title for those IDS even though we're already in another loop for the Product post?

Thanks!

Is there any documentation that you are following?

No.

Is there a similar example that we can see?

What is the link to your site?

#563051

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - there is no native way that the your post relationship IDs of ACF relationship converted into the post title + link BUT there is an alternate solution.

You need to create the custom shortcode and pass the field holding the post relationship IDs and within the shortcode, you will get these related IDs and based on ID find the post information using WP_Query.

You will need the same kind of code as given with following ACF Doc link:
More info:
hidden link

If you still do not get how to do it, Please send me problem URL and temporary access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#563679

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Matthew,

Minesh is having a holiday today. I checked your WP login but it is not working, can you please double check username / password? I have enabled private box for your next reply.

Thank you

#563974

Thanks, I managed to sort the programming out myself.