Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="galerie">
- <div class="container-fluid tz-gallery p-0">
- <?php
- $args = array(
- 'post_type' => 'gallery',
- 'taxonomy' => 'tagsu',
- 'orderby' => 'ID',
- 'order' => 'ASC',
- 'hide_empty' => 1,
- );
- $cats = get_categories($args);
- ?>
- <ul class="nav nav-tabs ultab " id="left_column_date_search" style="justify-content: center ">
- <?php
- $counter = 0;
- foreach($cats as $cat):
- // var_dump($cats);
- ?>
- <li class="nav-item">
- <a class="nav-link menu-style <?= $counter == 0 ? 'active' : '' ;?>" id="<?= $cat->slug;?>"
- data-toggle="tab" href="#post-<?= $cat->slug;?>">
- <?php echo $cat->slug ;?>
- </a>
- </li>
- <?php $counter++;
- endforeach;
- wp_reset_query();?>
- </ul>
- <?php
- $args = array(
- 'taxonomy' => 'tagsu',
- 'orderby' => 'ID',
- 'order' => 'ASC',
- 'hide_empty' => 1,
- );
- $cats = get_categories($args);
- ?>
- <div class="tab-content">
- <?php
- $counter = 0;
- foreach($cats as $cat):
- ?>
- <div role="tabpanel" class="tab-pane <?=$counter == 0 ? 'active show' : '';?>" id="post-<?= $cat->slug; ?>">
- <div class="row m-0">
- <?php
- $args1 = array(
- 'posts_per_page' => -1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'tagsu',
- 'field' => 'slug',
- 'terms' => $cat->slug
- )
- ),
- 'post_type' => 'gallery',
- 'orderby' => 'title',
- 'order' => 'ASC',
- );
- $wp_query = new WP_Query($args1);
- while($wp_query->have_posts()): $wp_query->the_post();
- ?>
- <div class="col-lg-3 col-md-4 col-sm-6 col-12 p-0">
- <div class="single-image">
- <a href="<?php the_post_thumbnail_url();?>" class="lightbox">
- <?php the_post_thumbnail();?>
- </a>
- </div>
- </div>
- <?php
- $counter++;
- endwhile;
- wp_reset_postdata(); ?>
- </div>
- </div>
- <?php endforeach;
- wp_reset_query();?>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement