File: /home/shaping-sar.ru/public_html/wp-content/themes/beauty spa/builder/template/meal_cat.php
<?php
extract( shortcode_atts( array(
'title' => '',
'span' => '',
'meal_cat' => '',
), $atts ) );
$term = get_term( $meal_cat, 'meal' );
?>
<h1 class="wow <?php echo esc_attr($title_animation); ?>" data-wow-delay="0.3s"><?php echo esc_attr($title); if($span != '') : ?><span> <?php echo esc_attr($span); ?> </span> <?php endif; ?></h1>
<div class="bigIcon view-type">
<a class="viewList active wow fadeInLeft" data-wow-delay="0.3s" href="#" title="List View"><i class="fa fa-list"></i> <?php _e('List View', IZPL_LANG) ?></a>
<a class="viewGrid wow fadeInRight" data-wow-delay="0.3s" href="#" title="Grid View"><i class="fa fa-th"></i> <?php _e('Grid View', IZPL_LANG) ?></a>
</div>
<?php if( is_object($term) && !isset($term->errors) ) : ?>
<div id="menu-carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="breakfast-wrap">
<div class="col-md-5 menu-category-info">
<div class="info">
<h2><?php echo esc_attr($term->name) ?></h2>
<p><?php echo esc_textarea($term->description); ?></p>
<div class="container-fluid gallery">
<?php
$thumbnail_id = absint( get_iz_term_meta( $term->term_id, 'thumbnail_id', true ) );
if ( $thumbnail_id ) {
$image = wp_get_attachment_image_src( $thumbnail_id , array(700, 700) );
$image = $image[0];
} else {
$image = iz_placeholder_img_src();
}
?>
<div class="col-md-12 col-sm-12 col-xs-12"><img class="img-responsive" src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr($term->name); ?>" /></div>
</div>
</div>
</div>
<div class="col-md-7 food-item-list">
<?php
$args = array(
'post_type' => 'iz_menu',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'meal',
'field' => 'id',
'terms' => $term->term_id,
),
),
);
$menu = new WP_Query($args);
while ($menu->have_posts()) {
$menu->the_post();
?>
<div class="food-item clearfix">
<div class="food-img">
<?php
if(has_post_thumbnail())
{
the_post_thumbnail('iz-meal-thumbnail', array('class'=> 'img-responsive'));
}
else
{
echo '<img class="img-responsive" src="'.esc_url(iz_image_placeholder_url()).'" alt="'.__('Special Food menu', IZ_LANG).'" />';
}
$gallery = get_post_meta(get_the_ID(), '_iz_gallery', true);
$gallery = json_decode($gallery);
if(is_array($gallery))
{
foreach ($gallery as $id) {
if($id != '')
{
$image_url = wp_get_attachment_url($id);
if($image_url != '')
echo '<a href="'.$image_url.'" data-gal="prettyPhoto[gallerymenu-'.get_the_ID().'-'.$term->term_id.']" title="'.get_the_title(get_the_ID()).'"></a>';
}
}
}
?>
</div>
<div class="food-info">
<h4><?php the_title(); ?></h4>
<?php the_content() ?>
</div>
<h4 class="food-price"><?php echo iz_price(get_post_meta(get_the_ID(), '_iz_menu_price', true)); ?></h4>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php endif; ?>