div class row php newargs post_type our_works tax_query taxonomy categ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<div class="row">
<?php
$newargs = [
'post_type' => 'our_works',
'tax_query' => [[
'taxonomy' => 'category',
'field' => 'slug',
'terms' => $cat->slug
]]
];
$posts = query_posts($newargs);
foreach($posts as $post):
?>
<?php setup_postdata($post) ?>
<div class="col-lg-3">
<a class="services-item modal-link" href="<?php the_permalink(); ?>">
<div class="services-thumb">
<img src="<?php the_field('project_preview'); ?>" class="services-photo">
</div>
<div class="services-desc">
<div class="services-type"><?php the_field('project_name'); ?></div>
<div class="services-text"><?php the_field('project_short'); ?></div>
</div>
</a>
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
</div>