File: /home/workshopbrain/public_html/bradford/wp-content/themes/DDCM/img-map-query.php
<?php
echo '<h2>Tenant Spaces</h2><hr>';
$args = array( 'post_type' => 'tenant-space', 'category_name' => 'Tenant Space', 'orderby' => 'title', 'order' => ASC, 'posts_per_page' => 30 );
//$args = array( 'post_type' => 'imagemap_area', 'orderby' => 'title', 'order' => ASC, 'posts_per_page' => 30 );
//$args = array( 'post_type' => 'tenant-space', 'category_name' => 'Tenant Space', 'p=1460' );
//$query = new WP_Query( 'p=7' ); //I was trying to get this to work with no luck
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
//
$prop_stat2 = get_field('property_status');
//
if ( $prop_stat2 == 'available'){
$prop_stat_color = '#ff0000';
} else if ( $prop_stat2 == 'negotiation'){
$prop_stat_color = '#00ffff';
} else if ( $prop_stat2 == 'prospect'){
$prop_stat_color = '#ffff00';
} else if ( $prop_stat2 == 'loi'){
$prop_stat_color = '#ff6600';
} else if ( $prop_stat2 == 'rec'){
$prop_stat_color = '#eb1e7b';
} else {
$prop_stat_color = '#00ff00';
}
//
//if ( $prop_stat2 == 'available'){
//$prop_stat = 'rgba(255, 0, 0, 0.1)';
//} else { $prop_stat = 'rgba(0, 255, 0, 0.1)'; }
//
//$originalDate = get_field('lease_end_date');
//$newDate = date("m-d-Y", strtotime($originalDate));
//
//if ( $prop_stat2 == 'available'){
//$statusText = '<p class="availableHeader"><span class="header-icons fa fa-check"></span>Available as of ';
//} else { $statusText = '<p class="leasedHeader"><span class="header-icons fa fa-check"></span>Currently leased until '; }
//
//
echo '<a href="';
the_permalink();
echo '" style="';
echo 'color:';
echo $prop_stat_color;
echo ';';
echo '">';
the_title();
echo '</a>';
echo '<br>';
endwhile;
?>