posts as $listing) :
$id = $listing->ID;
$url = get_permalink($id);
$title = get_the_title($id);
// Use only real excerpts; theme shortcode markup and confidential form fields are never output.
$excerpt = wp_trim_words(wp_strip_all_tags(strip_shortcodes($listing->post_excerpt)), 28);
$thumbnail = get_the_post_thumbnail($id, 'medium_large', array('loading' => 'lazy', 'decoding' => 'async'));
// AdForest commonly stores gallery attachment IDs in this field. Validate every ID before rendering.
if (!$thumbnail) {
$gallery = get_post_meta($id, '_adforest_ad_gallery', true);
$gallery = is_array($gallery) ? $gallery : (is_string($gallery) ? explode(',', $gallery) : array());
foreach ($gallery as $attachment) {
$attachment = absint($attachment);
if ($attachment && wp_attachment_is_image($attachment)) {
$thumbnail = wp_get_attachment_image($attachment, 'medium_large', false, array('loading' => 'lazy', 'decoding' => 'async'));
break;
}
}
}
?>
Accounting Services
No published accounting listings are available in this category at the moment.