function get_vins_from_type($type) { $args = array('post_type' => 'appellation', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'Types', 'field' => 'slug', 'terms' => $type))); $appellations = get_posts($args); foreach ($appellations as $vin) { echo '<div class="small-12 medium-3 columns">'; echo '<a href="' . get_post_permalink($vin->ID) . '"><article class="article-card">'; echo '<img src="' . thumb_or_first($vin->ID, false, false, 'medium') . '"/>'; echo '<div class="card-content">'; echo '<h2>' . $vin->post_title . '</h2></div></article></a></div>'; } }
</h1> <?php echo $section->post_content; ?> </div> <?php $img_left_side = false; } else { $img_left_side = true; //Image à droite ?> <div class="small-12 large-6 column content-img" style="background-image:url(<?php echo thumb_or_first($section->ID); ?> " data-equalizer-watch></div> <div class="small-12 large-6 column content-txt" data-equalizer-watch> <h1><?php echo $section->post_title; ?> </h1> <?php echo $section->post_content; ?> </div> <?php } ?>
<?php if (have_posts()) { while (have_posts()) { the_post(); ?> <h1><?php echo $type[0]->name; ?> </h1> <h2><?php echo $post->post_title; ?> </h2> <img src="<?php echo thumb_or_first($post->ID, false, true, 'medium'); ?> " /> <?php the_content(__('(more...)')); } } else { _e('Sorry, we couldn’t find the post you are looking for.'); } ?> </div> </div> </div> <?php