Title: [Advanced Custom Fields] Post Object
Last modified: August 20, 2016

---

# [Advanced Custom Fields] Post Object

 *  [royromviel](https://wordpress.org/support/users/royromviel/)
 * (@royromviel)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/)
 * I have a problem with the Post Object option.
 * Here is the thing. I have a custom posttype named Testimonials. That custom post
   type contains a excerpt.
 * No i have some pages that need the excerpts of some Testimonials pages.
    So i
   use the advanced custom field option Post Object. In my page template I use the
   example from the site:
 *     ```
       <ul>
       <?php foreach(get_field('post_object') as $post_object): ?>
           <li><a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID) ?></a></li>
       <?php endforeach; ?>
       </ul>
       ```
   
 * But when i check the page the page is giving me the permalink’s and the titles
   of the page im already on it. It makes a list of 25 items with the same.
 * Example: [http://www.trustpayrolling.nl/wordpress/onze-klanten/](http://www.trustpayrolling.nl/wordpress/onze-klanten/)
 * What do i do wrong?
 * Here is the full code of the page:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * [http://wordpress.org/extend/plugins/advanced-custom-fields/](http://wordpress.org/extend/plugins/advanced-custom-fields/)

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

 *  Thread Starter [royromviel](https://wordpress.org/support/users/royromviel/)
 * (@royromviel)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/#post-2437951)
 * C’mon… Nobody can answer my question?
 *  [Matt](https://wordpress.org/support/users/mhuntdesign/)
 * (@mhuntdesign)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/#post-2437983)
 * royromviel, Make sure you are using the foreach code snippet on the page template
   that corresponds with the page that you are making the selections. Use the relationship
   field if possible instead of the post object field in ACF. They are the same,
   but there is a better interface for relationship. Then, if you want to display
   the excerpt or content you will need to hook into the post type object attributes.
   Here is a reference: [http://www.sagalbot.com/blog/wordpress-post-object-reference/](http://www.sagalbot.com/blog/wordpress-post-object-reference/)
 * So to display the excerpts you need to do this:
 *     ```
       <ul>
       <?php foreach(get_field('post_object') as $post_object): ?>
           <li><a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID) ?></a> <p><?php print $post_object->post_excerpt; ?></p> </li>
       <?php endforeach; ?>
       </ul>
       ```
   
 * See how I have placed `<?php print $post_object->post_excerpt; ?>`
 * Let me know how it goes. Looks like it’s been a few weeks and you may have already
   moved on.
 *  Thread Starter [royromviel](https://wordpress.org/support/users/royromviel/)
 * (@royromviel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/#post-2437998)
 * Hey mhuntdesign,
 * Tnx for the reply. I will go into this soon. I will let you know how it went.
 *  [alturnwall](https://wordpress.org/support/users/alturnwall/)
 * (@alturnwall)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/#post-2438012)
 * Same question, and that worked for me, thank you mhuntdesign!

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

The topic ‘[Advanced Custom Fields] Post Object’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)

 * 4 replies
 * 3 participants
 * Last reply from: [alturnwall](https://wordpress.org/support/users/alturnwall/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/advanced-custom-fields-post-object/#post-2438012)
 * Status: not resolved