I’ve created a custom modal that I am using on Listing pages.
// Quote Modal Listing - Uses Listing Attributes
echo ( new HivePress\Blocks\Modal(
[
'title' => 'Contractor Details',
'name' => 'quote_modal_listing',
'blocks' => [
'listing_title' => [
'type' => 'content',
'content' => '<h2 class="hp-listing__title">' . get_the_title() . '</h2>',
'_order' => 100,
],
'listing_phone' => [
'type' => 'content',
'content' => '📱 ' . get_post_meta(get_the_ID(), 'hp-listing__attribute--phone', true),
'_order' => 110,
],
'listing_email' => [
'type' => 'content',
'content' => '📧 ' . get_post_meta(get_the_ID(), 'hp-listing__attribute--email', true),
'_order' => 120,
],
],
]
) )->render();
}
add_action('wp_footer', 'custom_hivepress_modals');
The modal works and the Listing name is displayed as expected, however the listing attribute phone
and attribute email
do not show any values. I’ve troubleshooted various methods of calling the attributes but Im not really sure what i need to do. Is there a proper way to display the values associated with listing attributes