Files
vij/index.php

110 lines
2.7 KiB
PHP
Raw Normal View History

2021-09-16 12:14:35 +03:00
<?php
/**
* The main template file.
*
*/
2022-03-12 16:30:23 +03:00
2021-09-20 01:07:53 +03:00
get_header();
$nn = 0;?>
2021-09-16 12:14:35 +03:00
2021-10-11 22:29:11 +03:00
<div id="content">
<h1 id="mainpage-title">Главное</h1>
<?include(get_template_directory().'/blocks/mainnews.php');?>
2023-03-23 13:18:58 +03:00
<?//include(get_template_directory().'/blocks/mainnews_happy.php');?>
2021-09-18 01:30:09 +03:00
<?php $query = new WP_Query(
2021-09-24 23:18:38 +03:00
array(
2021-10-09 22:59:32 +03:00
'category__in' => array(2),
2021-10-11 22:29:11 +03:00
'post__not_in' => array($mainpost_id),
2022-08-16 19:59:08 +03:00
'posts_per_page' => 24,
2021-09-24 23:18:38 +03:00
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
)
)
); # фильтруем рубрики
2021-09-18 01:30:09 +03:00
?>
2021-10-11 22:29:11 +03:00
<?php if($query->have_posts()) : ?>
2021-09-18 01:30:09 +03:00
2021-10-11 22:29:11 +03:00
<div class="mini-card-block">
2021-09-18 01:30:09 +03:00
2021-10-11 22:29:11 +03:00
<?php while($query->have_posts()) : $query->the_post();?>
2021-09-20 01:07:53 +03:00
2022-01-11 23:06:02 +03:00
<?$nn++?>
2023-07-28 11:59:42 +03:00
<?//if ($nn == 1):
//card_post_id(28999, '');
2023-03-23 13:18:58 +03:00
// include get_template_directory().'/blocks/card_post_happy.php';
2023-07-28 11:59:42 +03:00
//elseif($nn == 3):
//card_post_id(29001, '');
//elseif($nn == 4):
//card_post_id(29005, '');
2023-03-23 13:18:58 +03:00
//endif?>
2023-11-06 16:21:36 +03:00
<?//if($nn == 4):
//card_post_id(31271, '');
//endif?>
2022-10-14 16:50:33 +03:00
2023-03-23 13:18:58 +03:00
<?if ($nn < 25):?>
2021-10-31 13:01:31 +03:00
2021-10-11 22:29:11 +03:00
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img">
2022-04-11 22:13:36 +03:00
<a href="<?the_permalink();?>">
2022-10-30 01:46:41 +03:00
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url(null, 'full'))?>
<img class="mini-card-img" src="<?=$imgurl;?>" alt="<?the_title();?>">
2021-11-01 19:13:59 +03:00
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
2021-12-25 00:10:28 +03:00
</a>
2021-10-11 22:29:11 +03:00
</div>
<?endif?>
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="mini-card-body">
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
2022-10-14 16:50:33 +03:00
</div>
<?endif?>
2021-10-11 22:29:11 +03:00
2021-09-18 01:30:09 +03:00
<?php endwhile;?>
2021-10-11 22:29:11 +03:00
</div>
2021-09-20 01:07:53 +03:00
2021-09-18 01:30:09 +03:00
2021-09-27 00:07:02 +03:00
2021-10-31 13:01:31 +03:00
2021-09-18 01:30:09 +03:00
<?php endif;?>
2021-09-27 00:07:02 +03:00
<?php wp_reset_postdata();?>
2021-11-01 02:22:21 +03:00
<div class="publ-to-main">
<button class="more_button" onclick="location.href='<?=get_category_link(2)?>/page/2'" type="button">
Показать ещe</button>
</div>
2021-09-28 22:25:21 +03:00
<?get_template_part( '/blocks/opinion', null, ['subclass' => 'mob-lite']);?>
2021-12-23 22:44:35 +03:00
2021-12-06 21:51:01 +03:00
<?get_template_part( '/blocks/citats', null, ['subclass' => 'mob-lite']);?>
2021-12-23 22:44:35 +03:00
2021-09-18 01:30:09 +03:00
2023-03-23 13:18:58 +03:00
2021-09-20 01:07:53 +03:00
</div> <!-- end content -->
2021-09-16 12:14:35 +03:00
2023-03-23 13:18:58 +03:00
<?php //include get_template_directory().'/blocks/popunder.php';?>
2021-09-16 12:14:35 +03:00
2021-09-27 00:07:02 +03:00
<?php get_footer(); ?>