Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use Meta Box to build the product detail page
<div class="page-wrapper">
<div class="product-gallery--columns-4 images" data-columns="4">
<figure class="product-gallery__wrapper">
<a href="<?php echo get_the_post_thumbnail('full'); ?>">
<img src="<?php echo get_the_post_thumbnail('full'); ?>" alt="<?php the_title(); ?>">
</a>
<div class="thumbnails owl-carousel owl-loaded owl-drag">
<div class="owl-stage-outer">
<div class="owl-stage">
<div class="owl-item">
<?php
$gallery = rwmb_meta( 'car_gallery', array( 'size' => 'thumbnail', 'limit' => '5' ) );
foreach ( $gallery as $img ) {
echo '<div class="item"><a href="'. $img['full_url']. '"><img src ="'.$img['url']. '"></a></div>';
}
?>
</div>
</div>
</div>
</div>
</figure>
</div>
<div class="summary entry-summary">
<div class="price">
<span class="amount">
<span class="Price-amount amount">
<span class="Price-currencySymbol">$</span><?php echo $price = rwmb_meta('price'); ?>
</span>
</span>
<span class="label">/ Day</span>
</div>
<div class="product-details__short-description">
<p><?php the_excerpt(); ?></p>
</div>
<ul class="features">
<li> <label>Car year: </label> <span><?php echo $car_year = rwmb_meta('car_year'); ?></span></li>
<li> <label>Fuel: </label> <span><?php echo $fuel = rwmb_meta('fuel'); ?></span></li>
<li> <label>Gearbox: </label> <span><?php echo $gearbox = rwmb_meta('gearbox'); ?></span></li>
<li> <label>Fuel usage: </label> <span><?php echo $fuel_u = rwmb_meta('fuel_usage'); ?></span></li>
<li> <label>Max passengers: </label> <span><?php echo $max_passengers = rwmb_meta('max_passengers'); ?></span></li>
<li> <label>Engine capacity: </label> <span><?php echo $engine_capacity = rwmb_meta('engine_capacity'); ?></span></li>
<li> <label>Max luggage: </label> <span><?php echo $max_luggage = rwmb_meta('max_luggage'); ?></span></li>
<li> <label>Doors: </label> <span><?php echo $door = rwmb_meta('door'); ?> Doors</span></li>
<li> <label>Mileage: </label> <span><?php echo $Mileage = rwmb_meta('Mileage'); ?></span></li>
</ul>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment