Home Forums General Issues Unable to display post objects list


Unable to display post objects list

  • I have a test site I’ve been experimenting with.

    I have 2 custom post types – One is “Doctors”, the other is “Facilities”.

    I’d like to be able to link doctors with their facilities they service. That way, when someone visits the doctor’s post page, it displays an array of the facilities that they service, (hopefully with links to these facilites.)

    I am using the Divi Theme Builder to display the doctor’s name, and their specialties. I have no issues with these two values.

    But when I add a post object and link the doctor to the facility and try to display this, nothing displays. Even worse, when I enable multiple values within the post object and select multiple values, I get the following error:

    Fatal error: Uncaught Error: Object of class WP_Post could not be converted to string in /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php:303 Stack trace: #0 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php(303): implode(‘, ‘, Array) #1 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php(98): ET_Builder_Plugin_Compat_Advanced_Custom_Fields->format_field_value(Array, Array) #2 /home/test/public_html/dtm/wp-includes/class-wp-hook.php(308): ET_Builder_Plugin_Compat_Advanced_Custom_Fields->maybe_filter_dynamic_content_meta_value(Array, ‘post_object_fac…’, 32) #3 /home/test/public_html/dtm/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #4 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/feature/dynamic-content.php(1674): apply_filters(‘et_builder_dyna…’, Array, ‘post_object_fac… in /home/alighttest/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php on line 303

    Any insight?

  • Also, if I enable “Post ID” instead of “POst Object” in the field, it displays the post ID’s in an array.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.