correct widjet pets
This commit is contained in:
@@ -15,14 +15,21 @@ foreach ( $subcats as $cat ) {
|
||||
}
|
||||
|
||||
// Получаем 3 случайных поста из этих категорий
|
||||
$args = array(
|
||||
$params = array(
|
||||
'category__in' => $category_ids,
|
||||
'posts_per_page' => 3,
|
||||
'post_status' => 'publish',
|
||||
'orderby' => 'rand'
|
||||
'orderby' => 'rand',
|
||||
'date_query' => array(
|
||||
array(
|
||||
'after' => '1 month ago',
|
||||
'inclusive' => true,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$random_posts = get_posts( $args );
|
||||
|
||||
$random_posts = get_posts( $params );
|
||||
|
||||
// Если нашли посты
|
||||
if ( $random_posts ) {
|
||||
@@ -31,7 +38,7 @@ if ( $random_posts ) {
|
||||
setup_postdata( $post );
|
||||
?>
|
||||
|
||||
<div class="pets-widget">
|
||||
<div class="pets-widget<?if ($args['subclass'] !== '') echo ' '.$args['subclass'];?>">
|
||||
<div class="pets-widget-maintitle"><a href="/pets">Питомцы</a></div>
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
|
||||
Reference in New Issue
Block a user