Files
vij/category.php
2021-09-24 23:18:38 +03:00

78 lines
2.2 KiB
PHP

<?php
/**
* The main template file.
*
*/
get_header();
$nn = 0;?>
<div id="content">
<ul id="nav_content">
<li><a href="http://beta.vetandlife.ru">Главная</li>
<li> - <?single_cat_title()?></li>
</ul>
<h1 class="my-4"><?=single_cat_title()?></h1>
<?php if(have_posts()) : while(have_posts()) : the_post();?>
<?$nn++;?>
<?if ($nn == 1):?>
<div class="main-card">
<?if ( has_post_thumbnail() ) :?>
<a href="<?the_permalink();?>"><img class="card-img-top" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
<?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>
<?elseif ($nn == 2):?>
<div class="mini-card-block">
<?endif?>
<?if ($nn > 1):?>
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
<?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;?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?><div class="pagination-wrapper"><?php the_posts_pagination( array(
'prev_text' => __( 'Предыдущая', 'quidus' ),
'next_text' => __( 'Следующая', 'quidus' ),
'end_size' => 2,
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'quidus' ) . ' </span>',
) );
?></div><?php endif;?>
</div> <!-- end content -->
<?php get_footer(); ?>