Title: Error using Post Object on V 4.0.3
Last modified: August 21, 2016

---

# Error using Post Object on V 4.0.3

 *  Resolved [bagwis](https://wordpress.org/support/users/bagwis/)
 * (@bagwis)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-using-post-object-on-v-403/)
 * Hello,
 * This is the first time I use this plugin and I admit this is really great, but
   unfortunately, I got an error when I am trying to echo the value of a post object.
   What I am want to do is first try to echo the value set in my Post Object, but
   I got this error message Post Object Custom Field:
    Catchable fatal error: Object
   of class WP_Post could not be converted to string in C:\xampp\htdocs\wordpress\
   wp-content\plugins\advanced-custom-fields\core\api.php on line 389. I followed
   the sample code in the website and since I only have one value for every post
   object I modified the code and made it like this
 * > $post_objects = get_field(‘field_51709d17971fb’);
   >  if( $post_objects ): ?>
   >  <?php foreach( $post_objects as $post_object): ?>
   >  <span>Post Object Custom Field: <?php the_field(‘order_equipment_name’, $post_object-
   > >ID); ?></span>
   >  <?php endforeach; ?>
   >  <?php endif;
 * Now my original plan is to update the quantity value in my product post type 
   by subtracting the quantity in the order post type, to achieve this, I have to
   provide the specific postid of the said product in the post object.
 * I downloaded the last 3.5.8 version and will try if this will work out for me.
   I hope that it would cause I badly need this one. Thanks
 * Kind Regards
 * [http://wordpress.org/extend/plugins/advanced-custom-fields/](http://wordpress.org/extend/plugins/advanced-custom-fields/)
 * UPDATE:
    I tried the version 3.5.8 but still I got the same error and also the
   custom fields that I created are still missing when I go to the custom fields,
   I can clearly see that there are 4 published custom fields but they aren’t showing.
   I don’t have other plugins installed aside from this and custom post type UI,
   I used to manually code the custom post type but I tried to use the plugin thinking
   that it might be the reason that my custom fields disappeared. But the same issue
   occurs. Thanks

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

 *  Thread Starter [bagwis](https://wordpress.org/support/users/bagwis/)
 * (@bagwis)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-using-post-object-on-v-403/#post-3675280)
 * Never mind the code, I was able to manage it, I realized that to echo the product
   name, it should be the, <?php the_title(); ?>.
 * Anyway, what I need now is the answer for my other question, why does my custom
   fields aren’t showing on my field groups?
 * Thanks
 *  Thread Starter [bagwis](https://wordpress.org/support/users/bagwis/)
 * (@bagwis)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-using-post-object-on-v-403/#post-3675352)
 * Sorry to bump this one again, I couldn’t find anymore the edit link. I can’t 
   achieve my goal using the code above, is there a way that I can immediately echo
   the value of a post object similar to the other custom types wherein entering
   the code the_field(‘$field_key’) will just echo the value of that field? I’ve
   been searching for more almos 24 hours now but I couldn’t find any idea. Thanks
 *  Thread Starter [bagwis](https://wordpress.org/support/users/bagwis/)
 * (@bagwis)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-using-post-object-on-v-403/#post-3675426)
 * Never mind, I resorted to manually code it myself. Thanks

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

The topic ‘Error using Post Object on V 4.0.3’ 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/)

 * 3 replies
 * 1 participant
 * Last reply from: [bagwis](https://wordpress.org/support/users/bagwis/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/error-using-post-object-on-v-403/#post-3675426)
 * Status: resolved