<?php $posts = get_posts( [
'category' => 76967,
'orderby' => date,
'numberposts' => 6,
] );?>
$query = new WP_Query( [
'orderby' => 'date',
'posts_per_page' => 6,
'category__and' => array( 76967, 2 ),
] );
$query = new WP_Query( [
'orderby' => 'date',
'posts_per_page' => 6,
'tax_query' => [
'relation' => 'AND',
[
'taxonomy' => 'category',
'field' => 'id',
'terms' => array( 76967, 2 ),
'operator' => 'AND',
]
]
] );
<?php if ($posts) : $counter = 0;?>
<div class="district-news">
<div class="td_block_wrap td_block_15 td-pb-border-top td_block_template_1 td-column-2 td_block_padding">
<div class="td-block-title-wrap">
<h4 class="block-title">
<span class="td-pulldown-size">Общество</span>
</h4>
</div>
<div class="td_block_inner td-column-2">
<div class="td-block-row">
<?php $posts = new WP_Query( [
'orderby' => 'date',
'posts_per_page' => 6,
'tax_query' => [
'relation' => 'AND',
[
'taxonomy' => 'category',
'field' => 'id',
'terms' => array( 76967, 2 ),
'operator' => 'AND',
]
]
] );?>
<?php foreach ($posts as $post) : setup_postdata ($post); $counter++; $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' );?>
<div class="td-block-span4">
<div class="td_module_mx4 td_module_wrap td-animation-stack">
<div class="td-module-image">
<div class="td-module-thumb">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<img width="320" height="240" class="entry-thumb" src="<?php echo $thumbnail_attributes[0];?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
</a>
</div>
</div>
<!--<div class="td-module-meta-info">
<span class="td-post-date">
<time class="entry-date updated td-module-date" ><?php the_date(); ?></time>
</span>
</div>-->
<h3 class="entry-title td-module-title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h3>
</div>
</div>
<?php if($counter % 3 === 0) {echo '</div>
<div class="td-block-row">';
}?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>