Files
vij/category-pets.php

93 lines
2.7 KiB
PHP
Raw Permalink Normal View History

2023-12-23 21:37:22 +03:00
<?php
/**
* The main template file.
*
*/
get_header( 'pets' );
2024-01-10 12:37:55 +03:00
$nn = 0;
$miniblock_open = false;?>
2023-12-23 21:37:22 +03:00
<div id="content">
2024-01-10 19:09:03 +03:00
<?$current_category = get_queried_object();
$category_id = $current_category->term_id;?>
2023-12-23 21:37:22 +03:00
<ul id="nav_content">
2024-01-10 19:09:03 +03:00
<?if ($category_id == 14):?>
<li>Питомцы</li>
<?else:?>
<li><a href="<?=get_home_url()?>/category/pets">Питомцы</a></li>
<li> - <?single_cat_title()?></li>
<?endif?>
2023-12-23 21:37:22 +03:00
</ul>
<?php if(have_posts()) : while(have_posts()) : the_post();?>
<?$nn++;?>
<?if ($nn == 1):?>
<div class="main-card">
<?if ( has_post_thumbnail() ) :?>
<div class="card-img-top">
<a href="<?the_permalink();?>"><img class="card-img-top" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>">
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
</a>
</div>
<?endif?>
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="main-card-body">
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
</div>
2024-01-10 12:37:55 +03:00
<?elseif ($nn > 1):?>
<?if ($nn == 2):?>
<?$miniblock_open = true;?>
<div class="mini-card-block">
<?endif?>
2023-12-23 21:37:22 +03:00
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img">
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url(null, 'full'))?>
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo $imgurl; ?>" alt="<?the_title();?>">
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
</a>
</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>
</div>
<?endif?>
<?php endwhile;?>
</div> <!--//end minicard block -->
<?else:?>
Здесь пока нет публикаций
<?php endif;?>
<?get_template_part( '/blocks/paginator');?>
2024-01-10 12:37:55 +03:00
<?if ($miniblock_open):?>
</div>
<?endif?>
2023-12-23 21:37:22 +03:00
<?php get_footer( 'pets' ); ?>