have_posts() ) : $query->the_post(); $post_id = get_the_ID(); $address = get_post_meta($post_id, 'abddir_address', true); $address2 = get_post_meta($post_id, 'abddir_address2', true); $city = get_post_meta($post_id, 'abddir_city', true); $state = get_post_meta($post_id, 'abddir_state', true); $zip = get_post_meta($post_id, 'abddir_zip', true); $phone = get_post_meta($post_id, 'abddir_phone', true); $email = get_post_meta($post_id, 'abddir_email', true); $website = get_post_meta($post_id, 'abddir_website', true); $contact_name = get_post_meta($post_id, 'abddir_contact_name', true); $description = get_post_meta($post_id, 'abddir_description', true); $facebook = get_post_meta($post_id, 'abddir_facebook', true); $instagram = get_post_meta($post_id, 'abddir_instagram', true); $twitter = get_post_meta($post_id, 'abddir_twitter', true); $linkedin = get_post_meta($post_id, 'abddir_linkedin', true); $youtube = get_post_meta($post_id, 'abddir_youtube', true); $tiktok = get_post_meta($post_id, 'abddir_tiktok', true); $pinterest = get_post_meta($post_id, 'abddir_pinterest', true); $abddir_logo = get_post_meta($post_id, 'abddir_logo', true); // abddir_logo can be a WP attachment ID (media picker) or a direct URL (legacy) if ( $abddir_logo && is_numeric( $abddir_logo ) ) { $thumb = wp_get_attachment_image_url( intval($abddir_logo), 'medium' ) ?: ''; } elseif ( $abddir_logo ) { $thumb = $abddir_logo; } else { $thumb = get_the_post_thumbnail_url( $post_id, 'medium' ) ?: ''; } $cats = wp_get_post_terms($post_id, 'abddir_category', ['fields' => 'names']); $community = get_post_meta($post_id, 'abddir_community', true); $country = get_post_meta($post_id, 'abddir_country', true); $full_address_parts = array_filter([$address, $address2]); if ( $_abddir_addr_fmt === 'international' ) { $city_state_zip = array_filter([$city, $state, $zip, $country]); } else { $city_state_zip = array_filter([$city, $state ? $state . ' ' . $zip : $zip]); } ?>

'; ?>

View Details → $facebook, 'instagram' => $instagram, 'twitter' => $twitter, 'linkedin' => $linkedin, 'youtube' => $youtube, 'tiktok' => $tiktok, 'pinterest' => $pinterest, ]); if ( ! empty($socials) ) : ?>