new archive
This commit is contained in:
@@ -4,11 +4,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
require TEMPLATEPATH.'/helpers/number_title.php';
|
||||
|
||||
get_header();
|
||||
$nn = 0;?>
|
||||
$nn = 0;
|
||||
$numbers_year = null?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
||||
|
||||
<ul id="nav_content">
|
||||
<li><a href="<?=get_home_url()?>">Главная</a></li>
|
||||
<li> - <?single_cat_title()?></li>
|
||||
@@ -16,26 +21,45 @@ $nn = 0;?>
|
||||
|
||||
<h1 class="my-4"><?single_cat_title()?></h1>
|
||||
|
||||
<div class="mini-card-block">
|
||||
<div class="numbers-anons">
|
||||
Федеральное отраслевое издание «Ветеринария и жизнь» – это информационный портал с ежедневным обновлением ленты новостей и ежемесячная полноцветная газета на 16 полос тиражом 5 тысяч экземпляров, распространяющаяся по всей России. Мы рассказываем об актуальных событиях в области ветеринарии, животноводства, птицеводства, рыбохозяйственного комплекса, рынков сырья и продовольствия. Публикуем аналитические материалы с комментариями ведущих российских и мировых экспертов, ученых научно-производственных институтов Россельхознадзора, руководителей федеральных ведомств и отраслевых ассоциаций.
|
||||
</div>
|
||||
|
||||
<? if (get_query_var('paged') > 0):?>
|
||||
|
||||
<p><br><strong>Архив временно недоступен</strong></p>
|
||||
|
||||
<?else:?>
|
||||
|
||||
|
||||
|
||||
<?php if(have_posts()) : while(have_posts()) : the_post();?>
|
||||
|
||||
|
||||
<?$curr_number = number_info(get_the_title());?>
|
||||
|
||||
<?if ($curr_number['year'] !== $numbers_year):?>
|
||||
|
||||
<?if ($numbers_year !== null):?>
|
||||
</div>
|
||||
<?endif?>
|
||||
<?$numbers_year = $curr_number['year'];?>
|
||||
<div class="numbers-year-title"><?=$numbers_year?></div>
|
||||
<div class="mini-card-block">
|
||||
<?endif?>
|
||||
|
||||
|
||||
<div class="mini-card">
|
||||
|
||||
<div class="mini-card-number">
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div class="mini-card-img">
|
||||
<a href="<?the_permalink();?>"><img class="mini-card-img" width="147" style="width: 147px;" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>"></a>
|
||||
<a href="<?the_permalink();?>"><img class="mini-card-number-img" width="147" style="width: 147px;" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>"></a>
|
||||
<?if( has_tag( 'видео' ) ):?>
|
||||
<span class="play-card"></span>
|
||||
<?endif?>
|
||||
</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> -->
|
||||
<h2 class="mini-card-number-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -51,6 +75,10 @@ $nn = 0;?>
|
||||
|
||||
<?get_template_part( '/blocks/paginator');?>
|
||||
|
||||
<?endif?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=65">
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=68">
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
|
||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/burger-menu.js?ver=9"></script>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
function number_pdf($title){
|
||||
function number_info($title){
|
||||
|
||||
$res = [];
|
||||
|
||||
$items = explode(' ', $title);
|
||||
$number = substr($items[2], 1, strlen($items[2]) - 2);
|
||||
@@ -10,10 +12,12 @@ function number_pdf($title){
|
||||
|
||||
$findpdf = db_get("SELECT * FROM `wp_posts` WHERE `post_name` = '$name' ORDER BY `post_modified` DESC LIMIT 1");
|
||||
|
||||
if (isset($findpdf ['guid']))
|
||||
return $findpdf ['guid'];
|
||||
if (isset($findpdf ['guid'])){
|
||||
$res['guid'] = $findpdf['guid'];
|
||||
$res['year'] = $items[4];
|
||||
}
|
||||
|
||||
return '';
|
||||
return $res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ get_header();?>
|
||||
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
|
||||
</ul>
|
||||
|
||||
<?$current_pdf = number_pdf(get_the_title())?>
|
||||
<?$curr_number = number_info(get_the_title())?>
|
||||
|
||||
|
||||
<h1 class="post-h1">Федеральное отраслевое издание «Ветеринария и жизнь»</h1>
|
||||
@@ -36,11 +36,10 @@ get_header();?>
|
||||
</div>
|
||||
<div class="number_title">
|
||||
<div class="number_number"><?the_title()?></div>
|
||||
<?if ($current_pdf !== ''):?>
|
||||
<?if (isset($curr_number['guid'])):?>
|
||||
<div>
|
||||
<a href="<?=$current_pdf?>" class="orange_button" target="_blank">Читать PDF версию</a>
|
||||
<a href="<?=$curr_number['guid']?>" class="orange_button" target="_blank">Читать PDF версию</a>
|
||||
</div>
|
||||
<!-- <button class="sub_button" onclick="location.href='<?=$current_pdf?>'" type="button">Читать PDF версию</button> -->
|
||||
<?endif?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
34
style.css
34
style.css
@@ -1028,6 +1028,40 @@ a{
|
||||
|
||||
}
|
||||
|
||||
.mini-card-number-img{
|
||||
width: 147px;
|
||||
}
|
||||
|
||||
.mini-card-number{
|
||||
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 14px 27px rgb(242, 242, 242);
|
||||
text-align: center;
|
||||
margin: 22px;
|
||||
padding-top: 24px;
|
||||
padding-bottom: 32px;
|
||||
|
||||
}
|
||||
|
||||
.mini-card-number-title{
|
||||
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
margin-top: 12px;
|
||||
|
||||
}
|
||||
|
||||
.numbers-anons{
|
||||
font-size: 16px;
|
||||
color: #171717;
|
||||
}
|
||||
|
||||
.numbers-year-title{
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #F2F2F2;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.play-card{
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user