$tco_slides = array();
$loop = new WP_Query(array(‘post_type’ => ‘tco_slider’,’posts_per_page’ => 24,’orderby’ => ‘menu_order’,’order’ => ‘ASC’));
while ($loop->have_posts()) {
$loop->the_post();
$post_id = get_the_ID();
$metadata = get_post_custom($post_id);
$mainimage = ”;
$mainimage_id = intval($metadata[‘_thumbnail_id’][0]);
if ($mainimage_id > 0) $mainimage = $wpdb->get_var(“SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE post_id=’$mainimage_id’ and meta_key=’_wp_attached_file’ LIMIT 1;”);
$tco_slides[] = array(
‘first_name’ => $metadata[‘_tco_first_name’][0],
‘last_name’ => $metadata[‘_tco_last_name’][0],
‘thumbnail’ => $metadata[‘_tco_thumbnail’][0],
‘slide_image’ => $mainimage,
‘black’ => $metadata[‘_tco_black_first_name’][0],
‘precontent’ => $metadata[‘_tco_precontent’][0],
‘prewhite’ => $metadata[‘_tco_precontent_style’][0],
‘preright’ => $metadata[‘_tco_preright’][0],
‘prevideo’ => $metadata[‘_tco_videourl’][0],
‘preaudio’ => $metadata[‘_tco_audiourl’][0],
‘content’ => get_the_content(),
);
}
$total_slides = count($tco_slides);
?>
8901 North Kings Highway
Myrtle Beach, SC 29572
Group Sales
843.913.1450
800.633.1508
Corporate
843.913.1400