Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <main id="primary" class="site-main mt-40">
- <div class="container">
- <?php $args = array(
- 'post_type' => 'prodotto',
- 'posts_per_page' => -1, //show all posts
- 'tax_query' => array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'categorie',
- 'terms' => 'term-name',
- ),
- array(
- 'taxonomy' => 'destinazione',
- 'terms' => 'term-name',
- ),
- )
- );
- $posts = new WP_Query($args);
- if( $posts->have_posts() ): ?>
- <div class="row list_destination">
- <div class="col-md-12">
- <h2 class="heading">
- <?php
- $terms = get_the_terms( $post->ID , 'categorie' );
- if ( $terms != null ){
- foreach( $terms as $term ) {
- echo $term->name;
- unset($term); } } ?>
- </h2>
- </div>
- <?php while( $posts->have_posts() ) : $posts->the_post(); ?>
- <div class="col-md-4 item">
- <?php $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'img-l'); ?>
- <div class="card" style="background-image: url('<?php echo $featured_img_url; ?>')">
- <div class="content">
- <h3> <?php echo get_the_title(); ?> </h3>
- <p><?php the_field('tagline'); ?></p>
- </div>
- </div>
- </div>
- <?php endwhile; ?>
- </div>
- <?php endif; ?>
- </div>
- </main><!-- #main -->
Add Comment
Please, Sign In to add comment