Get post field using Relationship field
-
Hi all
Another realtionship question sorry
I have a custom post type for testimonials.
The custom post has a testimonial_image, testimonial_text and testimonial_link, that are also CFS fields
I’m using a relationship field ‘the_testimonial’ to select one of the testimonial posts on the home page.
This is all working and I can select a post and echo the title of this post.
<?php $values = $cfs->get('the_testimonial'); foreach ($values as $post_id) { echo '<div class="well">'; $the_post = get_post($post_id); echo '<h2>' .$the_post->post_title. '</h2>'; echo '<p>'. $the_post-> get('testimonial_text').'</p>'; echo '</div>'; } ?>
How can I display the other fields fron the testimonial, like the testimonial_text, testimonial_text and testimonial_link.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get post field using Relationship field’ is closed to new replies.