Merge branch 'master' of ssh://gl.arguments.ru:2224/ak/vij-theme

This commit is contained in:
2021-11-21 22:00:41 +03:00
5 changed files with 82 additions and 17 deletions

View File

@@ -4,10 +4,15 @@
* *
*/ */
require TEMPLATEPATH.'/helpers/number_title.php';
get_header(); get_header();
$nn = 0;?> $nn = 0;
$numbers_year = null?>
<div id="content"> <div id="content">
<ul id="nav_content"> <ul id="nav_content">
<li><a href="<?=get_home_url()?>">Главная</a></li> <li><a href="<?=get_home_url()?>">Главная</a></li>
@@ -16,26 +21,45 @@ $nn = 0;?>
<h1 class="my-4"><?single_cat_title()?></h1> <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();?> <?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() ) :?> <?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img"> <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( 'видео' ) ):?> <?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span> <span class="play-card"></span>
<?endif?> <?endif?>
</div> </div>
<?endif?> <?endif?>
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2> <h2 class="mini-card-number-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> </div>
@@ -51,6 +75,10 @@ $nn = 0;?>
<?get_template_part( '/blocks/paginator');?> <?get_template_part( '/blocks/paginator');?>
<?endif?>
</div> </div>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <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"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title> <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"> <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/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> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/burger-menu.js?ver=9"></script>

View File

@@ -1,6 +1,8 @@
<?php <?php
function number_pdf($title){ function number_info($title){
$res = [];
$items = explode(' ', $title); $items = explode(' ', $title);
$number = substr($items[2], 1, strlen($items[2]) - 2); $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"); $findpdf = db_get("SELECT * FROM `wp_posts` WHERE `post_name` = '$name' ORDER BY `post_modified` DESC LIMIT 1");
if (isset($findpdf ['guid'])) if (isset($findpdf ['guid'])){
return $findpdf ['guid']; $res['guid'] = $findpdf['guid'];
$res['year'] = $items[4];
}
return ''; return $res;
} }

View File

@@ -24,7 +24,7 @@ get_header();?>
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li> <li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
</ul> </ul>
<?$current_pdf = number_pdf(get_the_title())?> <?$curr_number = number_info(get_the_title())?>
<h1 class="post-h1">Федеральное отраслевое издание «Ветеринария и жизнь»</h1> <h1 class="post-h1">Федеральное отраслевое издание «Ветеринария и жизнь»</h1>
@@ -36,11 +36,10 @@ get_header();?>
</div> </div>
<div class="number_title"> <div class="number_title">
<div class="number_number"><?the_title()?></div> <div class="number_number"><?the_title()?></div>
<?if ($current_pdf !== ''):?> <?if (isset($curr_number['guid'])):?>
<div> <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> </div>
<!-- <button class="sub_button" onclick="location.href='<?=$current_pdf?>'" type="button">Читать PDF версию</button> -->
<?endif?> <?endif?>
</div> </div>
<?endif?> <?endif?>

View File

@@ -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{ .play-card{
position: absolute; position: absolute;