Cars demo – display code

mgibbs189

{{gist file=”display-code.php” lang=”php”}}
<?php

while ( $query->have_posts() ): $query->the_post();

$photo_url = get_bloginfo( ‘stylesheet_directory’ ) . ‘/img/cars/’;
$photo_url .= CFS()->get( ‘photo_url’ );

?>

<div class=”car-item” style=”position:relative”>
<img src=”<?php echo $photo_url; ?>?1″ alt=”” />
<div class=”car-desc” style=”position:absolute;top:0; background:rgba(255,255,255,0.9); padding:10px 20px; font-size:13px”>
<div class=”car-title”><a href=”javascript:alert(‘This is a link’)”><?php the_title(); ?></a></div>
<div class=”car-msrp”>from $<?php echo number_format( CFS()->get( ‘base_msrp’ ) ); ?></div>
<div class=”car-stats”>
<div class=”car-mpg”>
<strong>MPG:</strong>
<?php echo CFS()->get( ‘mpg_city’ ); ?> city
<?php echo CFS()->get( ‘mpg_highway’ ); ?> hwy
</div>
<div class=”car-power”>
<strong>Power:</strong>
<?php echo CFS()->get( ‘horsepower’ ); ?> hp
<?php echo CFS()->get( ‘torque’ ); ?> ft/lb
</div>
</div>
</div>
</div>

<?php endwhile;

{{/gist}}