Compare commits
2 Commits
6ab9106be0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| db4a7c7c38 | |||
| 09ef3e1d6d |
@@ -2,9 +2,7 @@
|
||||
|
||||
if (LANG_VERSION == 'en'){
|
||||
$left_mob_menu = 'leftenmenu';
|
||||
|
||||
$part_title = 'Topics';
|
||||
|
||||
}
|
||||
else{
|
||||
$left_mob_menu = 'leftmenu';
|
||||
@@ -16,42 +14,55 @@ else{
|
||||
<?php $menu_items = wp_get_nav_menu_items('mainmenu-pets');?>
|
||||
|
||||
<div id="mobile_main_menu">
|
||||
|
||||
|
||||
<div class="main_main">
|
||||
|
||||
<ul id="gamburer_menu" class="menu">
|
||||
<li id="rubrics_start"><a href="#"><?=$part_title?><span class="rub_arrow">></span></a></li>
|
||||
<?foreach ($menu_items as $item):?>
|
||||
<li><a href="<?=$item->url?>"><?=$item->title?></a></li>
|
||||
<?endforeach?>
|
||||
|
||||
<!-- Добавлена строка поиска в основное меню -->
|
||||
<li class="mobile-search-item">
|
||||
<form role="search" method="get" class="mobile-search-form" action="<?php echo esc_url(home_url('/')); ?>">
|
||||
<input type="search" class="mobile-search-field" placeholder="<?php echo esc_attr_x('Поиск...', 'placeholder', 'textdomain'); ?>" value="<?php echo get_search_query(); ?>" name="s" />
|
||||
<button type="submit" class="mobile-search-submit"><?php echo esc_html_x('Найти', 'submit button', 'textdomain'); ?></button>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<?php foreach ($menu_items as $item): ?>
|
||||
<li><a href="<?php echo esc_url($item->url); ?>"><?php echo esc_html($item->title); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mob_menu_contacts">
|
||||
<div class="mob_menu_tel">+7 (495) 925 06 34</div>
|
||||
<div class="mob_menu_mail"><a href="maito:info@vetandlife.ru">info@vetandlife.ru</a></div>
|
||||
<div class="mob_menu_mail"><a href="mailto:info@vetandlife.ru">info@vetandlife.ru</a></div>
|
||||
</div>
|
||||
|
||||
<div class="mob_menu_info">
|
||||
<?php include get_template_directory().'/blocks/mobile-gazeta.php';?>
|
||||
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
||||
<?php include get_template_directory().'/blocks/social-buttons-pets.php';?>
|
||||
<?php include get_template_directory().'/partials/social-pets.php';?>
|
||||
</div>
|
||||
|
||||
<?php /**wp_nav_menu( array(
|
||||
'container_class' => 'main_main',
|
||||
'menu' => 'mob_topmenu',
|
||||
'menu_id' => 'gamburer_menu'
|
||||
) ); **/?>
|
||||
<div id="mobile_submenu">
|
||||
<div id="lang_mobile_title"><a href="<?=get_site_url().vij_lang('btn_lan_link', LANG_VERSION)?>"><?=vij_lang('btn_lan', LANG_VERSION)?></a></div>
|
||||
<div id="closed_mobile_menu"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mobile_rubrics_menu">
|
||||
<div id='rubrics_back'><strong><</strong> <span class="rub_back_title"><?=vij_lang('back_btn_rubric_menu', LANG_VERSION)?></span></div>
|
||||
<div id='rubrics_back'><strong><</strong> <span class="rub_back_title"><?php echo vij_lang('back_btn_rubric_menu', LANG_VERSION); ?></span></div>
|
||||
|
||||
<!-- Добавлена строка поиска в меню рубрик -->
|
||||
<div class="rubrics-search-container">
|
||||
<form role="search" method="get" class="rubrics-search-form" action="<?php echo esc_url(home_url('/')); ?>">
|
||||
<input type="search" class="rubrics-search-field" placeholder="<?php echo esc_attr_x('Поиск по сайту...', 'placeholder', 'textdomain'); ?>" value="<?php echo get_search_query(); ?>" name="s" />
|
||||
<button type="submit" class="rubrics-search-submit">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 19L13 13M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php wp_nav_menu(array(
|
||||
'menu_class' => 'menu_left',
|
||||
'menu' => 'pets-leftmenu'
|
||||
|
||||
@@ -22,6 +22,16 @@ else{
|
||||
|
||||
<ul id="gamburer_menu" class="menu">
|
||||
<li id="rubrics_start"><a href="#"><?=$part_title?><span class="rub_arrow">></span></a></li>
|
||||
|
||||
<!-- Добавлена строка поиска в основное меню -->
|
||||
<li class="mobile-search-item">
|
||||
<form role="search" method="get" class="mobile-search-form" action="<?php echo esc_url(home_url('/')); ?>">
|
||||
<input type="search" class="mobile-search-field" placeholder="<?php echo esc_attr_x('Поиск...', 'placeholder', 'textdomain'); ?>" value="<?php echo get_search_query(); ?>" name="s" />
|
||||
<button type="submit" class="mobile-search-submit"><?php echo esc_html_x('Найти', 'submit button', 'textdomain'); ?></button>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
|
||||
<?foreach ($menu_items as $item):?>
|
||||
<li><a href="<?=$item->url?>"><?=$item->title?></a></li>
|
||||
<?endforeach?>
|
||||
@@ -29,6 +39,7 @@ else{
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mob_menu_contacts">
|
||||
<div class="mob_menu_tel">+7 (495) 925 06 34</div>
|
||||
<div class="mob_menu_mail"><a href="maito:info@vetandlife.ru">info@vetandlife.ru</a></div>
|
||||
@@ -37,7 +48,7 @@ else{
|
||||
<div class="mob_menu_info">
|
||||
<?php include get_template_directory().'/blocks/mobile-gazeta.php';?>
|
||||
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
||||
<?php include get_template_directory().'/blocks/social-buttons.php';?>
|
||||
<?php include get_template_directory().'/blocks/social-vij.php';?>
|
||||
</div>
|
||||
|
||||
<?php /**wp_nav_menu( array(
|
||||
@@ -46,7 +57,6 @@ else{
|
||||
'menu_id' => 'gamburer_menu'
|
||||
) ); **/?>
|
||||
<div id="mobile_submenu">
|
||||
<div id="lang_mobile_title"><a href="<?=get_site_url().vij_lang('btn_lan_link', LANG_VERSION)?>"><?=vij_lang('btn_lan', LANG_VERSION)?></a></div>
|
||||
<div id="closed_mobile_menu"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,13 +3,20 @@
|
||||
|
||||
<?php include TEMPLATEPATH.'/blocks/gamburger-pets.php'; ?>
|
||||
|
||||
<div id="petslogo">
|
||||
<div id="petslogo" class="petslogo petslogo-desc">
|
||||
<a href="<?=home_url();?>/pets">
|
||||
<img src="<?=get_template_directory_uri()?>/pub/icons/logo-pets.svg" alt="Питомцы. Все о домашних животных">
|
||||
<img src="<?=get_template_directory_uri()?>/pub/icons/pitomzy_logo_white.svg" alt="Питомцы. Все о домашних животных">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pets-dog"></div>
|
||||
|
||||
<div class="petslogo-mob">
|
||||
<a href="<?=home_url();?>/pets">
|
||||
<img src="<?=get_template_directory_uri()?>/pub/logo/pitomcy-logo-mob.svg" alt="Питомцы. Все о домашних животных">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php include TEMPLATEPATH.'/partials/slider-pets.php'; ?>
|
||||
|
||||
<div id="mainmenu">
|
||||
|
||||
@@ -26,78 +33,40 @@
|
||||
<div class="head-mail-pets"><a href="mailto:info@vetandlife.ru">info@vetandlife.ru</a></div>
|
||||
</div>
|
||||
|
||||
<ul class="header-icons-pets">
|
||||
<li class="btn-search-pets"><a href="<?=get_site_url()?>?s"><svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="lupa 1" clip-path="url(#clip0_113_6807)">
|
||||
<path id="Vector" d="M17.71 16.29L14.31 12.9C15.407 11.5025 16.0022 9.77666 16 8C16 6.41775 15.5308 4.87103 14.6518 3.55544C13.7727 2.23985 12.5233 1.21447 11.0615 0.608967C9.59966 0.00346619 7.99113 -0.15496 6.43928 0.153721C4.88743 0.462403 3.46197 1.22433 2.34315 2.34315C1.22433 3.46197 0.462403 4.88743 0.153721 6.43928C-0.15496 7.99113 0.00346619 9.59966 0.608967 11.0615C1.21447 12.5233 2.23985 13.7727 3.55544 14.6518C4.87103 15.5308 6.41775 16 8 16C9.77666 16.0022 11.5025 15.407 12.9 14.31L16.29 17.71C16.383 17.8037 16.4936 17.8781 16.6154 17.9289C16.7373 17.9797 16.868 18.0058 17 18.0058C17.132 18.0058 17.2627 17.9797 17.3846 17.9289C17.5064 17.8781 17.617 17.8037 17.71 17.71C17.8037 17.617 17.8781 17.5064 17.9289 17.3846C17.9797 17.2627 18.0058 17.132 18.0058 17C18.0058 16.868 17.9797 16.7373 17.9289 16.6154C17.8781 16.4936 17.8037 16.383 17.71 16.29ZM2 8C2 6.81332 2.3519 5.65328 3.01119 4.66658C3.67047 3.67989 4.60755 2.91085 5.7039 2.45673C6.80026 2.0026 8.00666 1.88378 9.17055 2.11529C10.3344 2.3468 11.4035 2.91825 12.2426 3.75736C13.0818 4.59648 13.6532 5.66558 13.8847 6.82946C14.1162 7.99335 13.9974 9.19975 13.5433 10.2961C13.0892 11.3925 12.3201 12.3295 11.3334 12.9888C10.3467 13.6481 9.18669 14 8 14C6.4087 14 4.88258 13.3679 3.75736 12.2426C2.63214 11.1174 2 9.5913 2 8Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_113_6807">
|
||||
<rect width="19" height="19" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg></a></li>
|
||||
<li class="btn-rss-pets"><a href="<?=get_site_url()?>/rss/news.xml"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="rss 1" clip-path="url(#clip0_113_6809)">
|
||||
<path id="Vector" d="M0.000788094 0.962788C0.00568261 0.831348 0.0364593 0.702165 0.0913552 0.582638C0.146251 0.463111 0.224188 0.355587 0.320701 0.266226C0.417215 0.176865 0.53041 0.107422 0.653803 0.0618738C0.777195 0.0163256 0.908361 -0.0044327 1.03979 0.000788094C3.35979 0.0897881 6.81479 0.883788 9.71679 3.00479C12.6648 5.16079 15.0008 8.66079 15.0008 14.0008C15.0008 14.266 14.8954 14.5204 14.7079 14.7079C14.5204 14.8954 14.266 15.0008 14.0008 15.0008C13.7356 15.0008 13.4812 14.8954 13.2937 14.7079C13.1061 14.5204 13.0008 14.266 13.0008 14.0008C13.0008 9.34079 11.0038 6.42379 8.53579 4.62079C6.02179 2.78379 2.97579 2.07779 0.962788 2.00079C0.831348 1.99589 0.702165 1.96512 0.582638 1.91022C0.463111 1.85533 0.355587 1.77739 0.266226 1.68087C0.176865 1.58436 0.107422 1.47117 0.0618738 1.34777C0.0163256 1.22438 -0.0044327 1.09422 0.000788094 0.962788ZM0.00378788 6.92979C0.0227411 6.66541 0.145876 6.41938 0.346136 6.24575C0.546396 6.07211 0.807397 5.98509 1.07179 6.00379C2.38579 6.09679 4.32879 6.59379 5.97079 7.80979C7.65479 9.05579 9.00079 11.0498 9.00079 14.0008C9.00079 14.266 8.89543 14.5204 8.70789 14.7079C8.52036 14.8954 8.266 15.0008 8.00079 15.0008C7.73557 15.0008 7.48122 14.8954 7.29368 14.7079C7.10615 14.5204 7.00079 14.266 7.00079 14.0008C7.00079 11.7528 6.01379 10.3298 4.78079 9.41679C3.50679 8.47379 1.94979 8.07079 0.929788 7.99879C0.798701 7.98941 0.670749 7.95428 0.553247 7.89542C0.435746 7.83655 0.330999 7.75511 0.244998 7.65573C0.158996 7.55635 0.0934267 7.441 0.0520381 7.31627C0.0106494 7.19153 -0.00574674 7.06086 0.00378788 6.92979ZM0.000788094 14.0008C0.000788094 13.7356 0.106145 13.4812 0.293682 13.2937C0.481218 13.1061 0.735572 13.0008 1.00079 13.0008H1.01079C1.276 13.0008 1.53036 13.1061 1.71789 13.2937C1.90543 13.4812 2.01079 13.7356 2.01079 14.0008C2.01079 14.266 1.90543 14.5204 1.71789 14.7079C1.53036 14.8954 1.276 15.0008 1.01079 15.0008H1.00079C0.735572 15.0008 0.481218 14.8954 0.293682 14.7079C0.106145 14.5204 0.000788094 14.266 0.000788094 14.0008Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_113_6809">
|
||||
<rect width="15" height="15" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg></a></li>
|
||||
<ul id="header_icons">
|
||||
<a href="<?=get_site_url()?>?s"><li class="btn_search"></li></a>
|
||||
<div class="toggle-nav-pets" id="toggle-nav"></div>
|
||||
</ul>
|
||||
|
||||
<ul class="header-social-pets">
|
||||
|
||||
<li>
|
||||
<a href="https://rutube.ru/u/pitomcy" title="Rutube ПИТОМЦЫ" target="_blank">
|
||||
<span class="socs soc-rutube-white"></span>
|
||||
<a href="https://rutube.ru/u/pitomcy/" title="Rutube ПИТОМЦЫ" target="_blank">
|
||||
<span class="soc soc-rutube"></span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://t.me/pitomcy_vetandlife" title="Telegram" target="_blank">
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="19.5" stroke="#7A7A7A"/>
|
||||
<path d="M18.1707 22.2269L17.8894 26.1357C18.2918 26.1357 18.466 25.9649 18.675 25.7598L20.5613 23.9783L24.47 26.807C25.1869 27.2018 25.6919 26.9939 25.8853 26.1553L28.451 14.275L28.4517 14.2743C28.679 13.2271 28.0684 12.8176 27.37 13.0745L12.2892 18.7802C11.26 19.175 11.2756 19.7419 12.1143 19.9988L15.9698 21.1839L24.9255 15.6463C25.347 15.3705 25.7302 15.5231 25.415 15.7989L18.1707 22.2269Z" fill="#7A7A7A"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://t.me/pitomcy_vetandlife" title="Telegram" target="_blank"
|
||||
class="soc soc-telegram"></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://vk.com/pitomcy_vetandlife" target="_blank" title="ВКонтакте">
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="19.5" stroke="#7A7A7A"/>
|
||||
<path d="M29.579 15.855C29.719 15.39 29.579 15.049 28.917 15.049H26.724C26.166 15.049 25.911 15.344 25.771 15.668C25.771 15.668 24.656 18.387 23.076 20.15C22.566 20.663 22.333 20.825 22.055 20.825C21.916 20.825 21.714 20.663 21.714 20.198V15.855C21.714 15.297 21.553 15.049 21.088 15.049H17.642C17.294 15.049 17.084 15.307 17.084 15.553C17.084 16.081 17.874 16.203 17.955 17.691V20.919C17.955 21.626 17.828 21.755 17.548 21.755C16.805 21.755 14.997 19.026 13.924 15.902C13.715 15.295 13.504 15.05 12.944 15.05H10.752C10.125 15.05 10 15.345 10 15.669C10 16.251 10.743 19.131 13.461 22.94C15.273 25.541 17.824 26.951 20.148 26.951C21.541 26.951 21.713 26.638 21.713 26.098V24.132C21.713 23.506 21.846 23.38 22.287 23.38C22.611 23.38 23.169 23.544 24.47 24.797C25.956 26.283 26.202 26.95 27.037 26.95H29.229C29.855 26.95 30.168 26.637 29.988 26.019C29.791 25.404 29.081 24.509 28.139 23.45C27.627 22.846 26.862 22.196 26.629 21.871C26.304 21.452 26.398 21.267 26.629 20.895C26.63 20.896 29.301 17.134 29.579 15.855Z" fill="#7A7A7A"/>
|
||||
</svg></a>
|
||||
|
||||
<a href="https://vk.com/pitomcy_vetandlife" title="ВКонтакте" target="_blank"
|
||||
class="soc soc-vk"></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://dzen.ru/pitomcy_vetandlife?favid=254162793" title="Дзен" target="_blank">
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="19.5" stroke="#7A7A7A"/>
|
||||
<g id="_Слой_1-2">
|
||||
<path fill="#7A7A7A" d="M20.2,11.8c0,3.3,0.3,5.2,1.5,6.5s3.1,1.5,6.5,1.5C28.1,15.4,24.6,11.9,20.2,11.8z"/>
|
||||
<path fill="#7A7A7A" d="M18.2,18.2c1.2-1.3,1.5-3.1,1.5-6.5c-4.4,0.1-7.9,3.6-8,8C15.1,19.8,17,19.5,18.2,18.2z"/>
|
||||
<path fill="#7A7A7A" d="M11.8,20.2c0.1,4.4,3.6,7.9,8,8c0-3.3-0.3-5.2-1.5-6.5S15.1,20.3,11.8,20.2z"/>
|
||||
<path fill="#7A7A7A" d="M28.2,20.2c-3.3,0-5.2,0.3-6.5,1.5s-1.5,3.1-1.5,6.5C24.6,28.1,28.1,24.6,28.2,20.2L28.2,20.2z"/>
|
||||
</g>
|
||||
<path fill="#7A7A7A" d="M20,1c10.5,0,19,8.5,19,19s-8.5,19-19,19S1,30.5,1,20S9.5,1,20,1 M20,0C9,0,0,9,0,20s9,20,20,20s20-9,20-20 S31,0,20,0z"/>
|
||||
</svg></a>
|
||||
<a href="https://ok.ru/pitomcy.vetandlife" title="Одноклассники" target="_blank"
|
||||
class="soc soc-ok"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://dzen.ru/pitomcy_vetandlife?favid=254162793" title="Дзен" target="_blank"
|
||||
class="soc soc-dzen"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://max.ru/pitomcy" title="Max" target="_blank"
|
||||
class="soc soc-max"></a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="menu-rubrics">
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
?>
|
||||
|
||||
<?php include TEMPLATEPATH.'/partials/slider-vij.php'; ?>
|
||||
|
||||
<div id="mainmenu">
|
||||
|
||||
<?php
|
||||
@@ -41,11 +43,14 @@
|
||||
|
||||
<ul id="header_icons">
|
||||
<a href="<?=get_site_url()?>?s"><li class="btn_search"></li></a>
|
||||
<a href="<?=get_site_url()?>/rss/news.xml"><li class="btn_rss"></li></a>
|
||||
<li class="toggle-nav" id="toggle-nav"></li>
|
||||
<!--<a href="<?=get_site_url().vij_lang('btn_lan_link', LANG_VERSION)?>"><li class="btn_lan"><nobr><?=vij_lang('btn_lan', LANG_VERSION)?></nobr></li></a>-->
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<?php include get_template_directory().'/partials/header-social.php';?>
|
||||
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VGN4NSFMW5"></script>
|
||||
<script>
|
||||
@@ -56,6 +61,11 @@
|
||||
gtag('config', 'G-VGN4NSFMW5');
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="menu-rubrics">
|
||||
|
||||
54
blocks/moread_all.php
Normal file
54
blocks/moread_all.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
$args = wp_parse_args($args, array(
|
||||
'posts_limit' => 8,
|
||||
'category_id' => 2
|
||||
));
|
||||
|
||||
|
||||
|
||||
$query = new WP_Query(
|
||||
array(
|
||||
'category__in' => array($args['category_id']),
|
||||
'posts_per_page' => $args['posts_limit'],
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => '_thumbnail_id',
|
||||
//'compare' => 'EXISTS'
|
||||
)
|
||||
)
|
||||
)
|
||||
); # фильтруем рубрики
|
||||
?>
|
||||
|
||||
<?php if($query->have_posts()) : ?>
|
||||
|
||||
|
||||
<div class="mini-card-block">
|
||||
|
||||
<?php while($query->have_posts()) : $query->the_post();?>
|
||||
|
||||
<div class="mini-card">
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div class="mini-card-img">
|
||||
<a href="<?the_permalink();?>">
|
||||
<?$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();?>">
|
||||
<?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>
|
||||
|
||||
<?php endwhile;?>
|
||||
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
|
||||
@@ -42,9 +42,7 @@ if ( $random_posts ) {
|
||||
<div class="pets-widget-maintitle"><a href="/pets">Питомцы</a></div>
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div>
|
||||
<?php the_post_thumbnail('medium'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<h3 class="pets-widget-title"><?php the_title(); ?></h3>
|
||||
</a>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
<a href="https://vk.com/vizhuvizh" target="_blank"><span class="socs soc-vk"></span></a>
|
||||
<a href="https://t.me/ViZHuvizh" target="_blank"><span class="socs soc-tg"></span></a>
|
||||
<a href="https://www.youtube.com/c/ВетеринарияиЖизнь" target="_blank"><span class="socs soc-rutube"></span></a>
|
||||
<a href="https://www.youtube.com/c/ВетеринарияиЖизнь" target="_blank"><span class="socs soc-dzen"></span></a>
|
||||
<a href="https://rutube.ru/channel/42943284/" target="_blank"><span class="socs soc-rutube"></span></a>
|
||||
<a href="https://dzen.ru/vetandlife" target="_blank"><span class="socs soc-dzen"></span></a>
|
||||
|
||||
<!-- <div class="btn soc_vk"></div>
|
||||
<div class="soc_btn soc_fb"></div>
|
||||
|
||||
@@ -23,95 +23,84 @@ get_header();?>
|
||||
<h1 class="my-4"><?single_cat_title()?></h1>
|
||||
|
||||
<div class="numbers-anons">
|
||||
<p>Федеральное отраслевое издание «Ветеринария и жизнь» выходит с 2017 года и является крупнейшим периодическим печатным изданием в сфере сельского хозяйства и ветеринарии. К скачиванию доступен архив за все годы существования издания.<br><br>
|
||||
Номера газеты выкладываются в общий доступ через месяц после выхода.<br><br>
|
||||
Заказать свежий номер можно на Wildberries по <u><a href="https://www.wildberries.ru/catalog/482667738/detail.aspx?targetUrl=EX" target="_blank">ссылке</a></u></p>
|
||||
<p>Федеральное отраслевое издание «Ветеринария и жизнь» выходит с 2017 года и является крупнейшим периодическим печатным изданием в сфере сельского хозяйства и ветеринарии. К скачиванию доступен архив за все годы существования издания.</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$page = get_query_var('paged');
|
||||
$curryear = date('Y');
|
||||
|
||||
$year_params = [
|
||||
|
||||
'posts_per_page' => -1,
|
||||
'category' => 3, // 19 - архив газеты,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'post_type' => 'post',
|
||||
'suppress_filters' => true
|
||||
|
||||
];
|
||||
|
||||
if ($page == 0) {
|
||||
$page = 1;
|
||||
$numbers_year = $curryear;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$numbers_year = $curryear - ($page - 1);
|
||||
}
|
||||
|
||||
|
||||
$curr_params = $year_params;
|
||||
$curr_params['year'] = $numbers_year;
|
||||
|
||||
$posts = get_posts($curr_params);
|
||||
|
||||
if (count($posts) == 0) {
|
||||
|
||||
$numbers_year = $numbers_year - 1;
|
||||
|
||||
$curr_params = $year_params;
|
||||
$curr_params['year'] = $numbers_year;
|
||||
|
||||
$posts = get_posts($curr_params);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?if (count($posts) > 0):?>
|
||||
|
||||
<div class="numbers-year-title"><?=$numbers_year?></div>
|
||||
|
||||
if (count($posts) > 0): ?>
|
||||
<div class="numbers-year-title"><?php echo $numbers_year; ?></div>
|
||||
<div class="mini-card-block">
|
||||
|
||||
<?foreach($posts as $post):
|
||||
<?php foreach($posts as $post):
|
||||
setup_postdata($post);
|
||||
|
||||
// Обработка ошибки в функции number_info()
|
||||
$curr_number = '';
|
||||
try {
|
||||
$curr_number = number_info(get_the_title());
|
||||
} catch (Exception $e) {
|
||||
// Логируем ошибку, но не прерываем выполнение
|
||||
error_log('Error in number_info: ' . $e->getMessage());
|
||||
$curr_number = ''; // или значение по умолчанию
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?$curr_number = number_info(get_the_title());?>
|
||||
|
||||
|
||||
<div class="mini-card-number">
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<div class="mini-card-img">
|
||||
<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( 'видео' ) ):?>
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<img class="mini-card-number-img" width="147" style="width: 147px;" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?php the_title(); ?>">
|
||||
</a>
|
||||
<?php if(has_tag('видео')): ?>
|
||||
<span class="play-card"></span>
|
||||
<?endif?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?endif?>
|
||||
<h2 class="mini-card-number-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||
<?php endif; ?>
|
||||
<h2 class="mini-card-number-title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div> <!--//end minicard block -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
|
||||
<?//get_template_part( '/blocks/paginator');?>
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
<div class="numbers-anons">
|
||||
<p>Номера газеты выкладываются в общий доступ через месяц после выхода.</p>
|
||||
<p>Заказать свежий номер можно на Wildberries по <u><a href="https://www.wildberries.ru/catalog/482667738/detail.aspx?targetUrl=EX" target="_blank">ссылке</a></u></p>
|
||||
</div>
|
||||
<div class="pagination-wrapper">
|
||||
<nav class="navigation pagination" role="navigation" aria-label="Записи">
|
||||
<div class="nav-links">
|
||||
|
||||
@@ -46,7 +46,6 @@ $nn = 0;?>
|
||||
<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><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
|
||||
<div class="mini-card-body">
|
||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
||||
</div>
|
||||
|
||||
@@ -31,26 +31,11 @@
|
||||
<?php //include VIJ_CACHE.'events.html';?>
|
||||
|
||||
<div class="right-info">
|
||||
<a href="https://rutube.ru/u/pitomcy" target="_blank">
|
||||
<a href="https://rutube.ru/u/Pets/" target="_blank">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2024/08/pets_rutube.jpg" width="240" height="200" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="right-info">
|
||||
<!-- Yandex.RTB R-A-4145099-1 -->
|
||||
<div id="yandex_rtb_R-A-4145099-1"></div>
|
||||
<script>
|
||||
window.yaContextCb.push(()=>{
|
||||
Ya.Context.AdvManager.render({
|
||||
"blockId": "R-A-4145099-1",
|
||||
"renderTo": "yandex_rtb_R-A-4145099-1"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
@@ -64,38 +49,10 @@ window.yaContextCb.push(()=>{
|
||||
<?php //include get_template_directory().'/blocks/archive.php';?>
|
||||
<?php //include VIJ_CACHE.'archive.html'?>
|
||||
|
||||
<?php get_template_part('/blocks/archive-pets');?>
|
||||
|
||||
<?php get_template_part('partials/formsubscript'); ?>
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
|
||||
$adv_left_1 = ex_adv_get_banner( 2 );
|
||||
if ($adv_left_1 !== ''):?>
|
||||
<div class="right-info">
|
||||
<?=$adv_left_1?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
|
||||
<?$adv_left_2 = ex_adv_get_banner( 4 );
|
||||
if ($adv_left_2 !== ''):?>
|
||||
<div class="right-info">
|
||||
<?=$adv_left_2?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?$adv_left_3 = ex_adv_get_banner( 5 );
|
||||
if ($adv_left_3 !== ''):?>
|
||||
<div class="right-info">
|
||||
<?=$adv_left_3?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
|
||||
<?endif?>
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
<?if (LANG_VERSION == 'en'){
|
||||
@@ -144,14 +101,14 @@ window.yaContextCb.push(()=>{
|
||||
|
||||
<?endif?>
|
||||
|
||||
<?php //include get_template_directory().'/blocks/mobile-gazeta.php';?>
|
||||
<?php include get_template_directory().'/blocks/mobile-magazin.php';?>
|
||||
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
|
||||
$left_mobail_1 = ex_adv_get_banner(6);
|
||||
//$left_mobail_1 = ex_adv_get_banner(6);
|
||||
if ($left_mobail_1 !== ''):?>
|
||||
<div class="mobile-info">
|
||||
<?=$left_mobail_1?>
|
||||
@@ -180,15 +137,6 @@ window.yaContextCb.push(()=>{
|
||||
|
||||
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
||||
|
||||
<!-- Yandex.RTB R-A-4145099-4 -->
|
||||
<script>
|
||||
window.yaContextCb.push(()=>{
|
||||
Ya.Context.AdvManager.render({
|
||||
"blockId": "R-A-4145099-4",
|
||||
"type": "floorAd",
|
||||
"platform": "touch"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -247,26 +195,10 @@ window.yaContextCb.push(()=>{
|
||||
<div class="footer-mail"><a href="mailto:info@vetandlife.ru">info@vetandlife.ru</a></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="socials-footer-pets">
|
||||
<a href="https://rutube.ru/u/pitomcy" target="_blank"><span class="socs soc-rutube"></span></a>
|
||||
<a href="https://vk.com/pitomcy_vetandlife" target="_blank"><span class="socs soc-vk"></span></a>
|
||||
<a href="https://t.me/pitomcy_vetandlife" target="_blank"><span class="socs soc-tg"></span></a>
|
||||
<a href="https://dzen.ru/pitomcy_vetandlife?favid=254162793" target="_blank">
|
||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="20" cy="20" r="19.5" stroke="#3B83B5"/>
|
||||
<g id="_Слой_1-2">
|
||||
<path fill="#3B83B5" d="M20.2,11.8c0,3.3,0.3,5.2,1.5,6.5s3.1,1.5,6.5,1.5C28.1,15.4,24.6,11.9,20.2,11.8z"/>
|
||||
<path fill="#3B83B5" d="M18.2,18.2c1.2-1.3,1.5-3.1,1.5-6.5c-4.4,0.1-7.9,3.6-8,8C15.1,19.8,17,19.5,18.2,18.2z"/>
|
||||
<path fill="#3B83B5" d="M11.8,20.2c0.1,4.4,3.6,7.9,8,8c0-3.3-0.3-5.2-1.5-6.5S15.1,20.3,11.8,20.2z"/>
|
||||
<path fill="#3B83B5" d="M28.2,20.2c-3.3,0-5.2,0.3-6.5,1.5s-1.5,3.1-1.5,6.5C24.6,28.1,28.1,24.6,28.2,20.2L28.2,20.2z"/>
|
||||
</g>
|
||||
<path fill="#3B83B5" d="M20,1c10.5,0,19,8.5,19,19s-8.5,19-19,19S1,30.5,1,20S9.5,1,20,1 M20,0C9,0,0,9,0,20s9,20,20,20s20-9,20-20 S31,0,20,0z"/>
|
||||
</svg>
|
||||
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="socials-footer">
|
||||
<?php include get_template_directory().'/partials/social-pets.php';?>
|
||||
</div>
|
||||
|
||||
<div id="footer_2">
|
||||
@@ -321,9 +253,7 @@ document.write('<img src="'+pr+'?uid=18820&ref='+r+'&rd='+rd+'" width="88" heigh
|
||||
|
||||
|
||||
</div>
|
||||
<?php if (!isset($_COOKIE['cookie_consent_accepted'])) {
|
||||
get_template_part('cookie-consent');
|
||||
}?>
|
||||
|
||||
</footer>
|
||||
<?php get_template_part( 'partials/formhash' );?>
|
||||
|
||||
|
||||
115
footer.php
115
footer.php
@@ -23,6 +23,7 @@
|
||||
|
||||
<?php // get_template_part( '/blocks/citats');
|
||||
get_template_part( '/blocks/pets');
|
||||
get_template_part( '/cats/cats-informer');
|
||||
//get_blocks_gen( 'citats' );?>
|
||||
<?php //include VIJ_CACHE.'opinion.html';?>
|
||||
<?php //get_template_part( '/blocks/citata', null, ['subclass' => '']);?>
|
||||
@@ -30,21 +31,6 @@
|
||||
<?php //include VIJ_CACHE.'events.html';?>
|
||||
|
||||
|
||||
<div class="right-info">
|
||||
<!-- Yandex.RTB R-A-4145099-1 -->
|
||||
<div id="yandex_rtb_R-A-4145099-1"></div>
|
||||
<script>
|
||||
window.yaContextCb.push(()=>{
|
||||
Ya.Context.AdvManager.render({
|
||||
"blockId": "R-A-4145099-1",
|
||||
"renderTo": "yandex_rtb_R-A-4145099-1"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
@@ -54,41 +40,28 @@ window.yaContextCb.push(()=>{
|
||||
|
||||
|
||||
<div id="right">
|
||||
<div id="socials">
|
||||
<a href="https://vk.com/vizhuvizh" target="_blank"><span class="socs soc-vk"></span></a>
|
||||
<a href="https://t.me/ViZHuvizh" target="_blank"><span class="socs soc-tg"></span></a>
|
||||
<a href="https://rutube.ru/channel/42943284/" target="_blank"><span class="socs soc-rutube"></span></a>
|
||||
<a href="https://dzen.ru/vetandlife" target="_blank"><span class="socs soc-dzen"></span></a>
|
||||
</div>
|
||||
|
||||
|
||||
<?php include get_template_directory().'/blocks/archive.php';?>
|
||||
<?php //include VIJ_CACHE.'archive.html'?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
<?if (function_exists('krutilka_placement')){
|
||||
echo krutilka_placement( 'right-desktop-1', 'right-info' );
|
||||
}?>
|
||||
|
||||
$adv_left = ex_adv_get_banner( 2 );
|
||||
if ($adv_left !== ''):?>
|
||||
<div class="right-info">
|
||||
<?=$adv_left?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
<?php get_template_part('partials/formsubscript'); ?>
|
||||
|
||||
<?if (function_exists('krutilka_placement')){
|
||||
echo krutilka_placement( 'right-desktop-2', 'right-info' );
|
||||
}?>
|
||||
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
<?if (function_exists('ex_adv_get_banner')):?>
|
||||
|
||||
$adv_left_2 = ex_adv_get_banner( 4 );
|
||||
if ($adv_left_2 !== ''):?>
|
||||
<div class="right-info">
|
||||
<?=$adv_left_2?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?$adv_left_3 = ex_adv_get_banner( 5 );
|
||||
if ($adv_left_3 !== ''):?>
|
||||
@@ -113,6 +86,10 @@ window.yaContextCb.push(()=>{
|
||||
get_blocks_gen( 'zakons' );
|
||||
}?>
|
||||
|
||||
<?if (function_exists('krutilka_placement')){
|
||||
echo krutilka_placement( 'right-desktop-3', 'right-info' );
|
||||
}?>
|
||||
|
||||
<?if (LANG_VERSION == 'en'):?>
|
||||
<?get_template_part( '/blocks/enmosts', null, ['subclass' => '']);?>
|
||||
<?get_template_part( '/blocks/enmosts', null, ['subclass' => 'mob-lite']);?>
|
||||
@@ -138,19 +115,12 @@ window.yaContextCb.push(()=>{
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
|
||||
$right_mobail_1 = ex_adv_get_banner( 9 );
|
||||
|
||||
if ($right_mobail_1 !== ''):?>
|
||||
<div class="mobile-info">
|
||||
<?=$right_mobail_1?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?endif?>
|
||||
<?if (function_exists('krutilka_placement')){
|
||||
echo krutilka_placement( 'mobile-1', 'mobile-info' );
|
||||
}?>
|
||||
|
||||
<?//get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
|
||||
<?php get_template_part( '/cats/cats-informer', null, ['subclass' => 'mob-lite']);?>
|
||||
<?include VIJ_CACHE.'top_mob.html'?>
|
||||
<?get_template_part( '/blocks/enmosts', null, ['subclass' => 'mob-lite']);?>
|
||||
|
||||
@@ -159,32 +129,14 @@ window.yaContextCb.push(()=>{
|
||||
<?php include get_template_directory().'/blocks/mobile-gazeta.php';?>
|
||||
|
||||
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
|
||||
<?if (function_exists('ex_adv_get_banner')):
|
||||
|
||||
$left_mobail_1 = ex_adv_get_banner(6);
|
||||
if ($left_mobail_1 !== ''):?>
|
||||
<div class="mobile-info">
|
||||
<?=$left_mobail_1?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?$left_mobail_2 = ex_adv_get_banner(7);
|
||||
if ($left_mobail_2 !== ''):?>
|
||||
<div class="mobile-info">
|
||||
<?=$left_mobail_2?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?$left_mobail_3 = ex_adv_get_banner(8);
|
||||
if ($left_mobail_3 !== ''):?>
|
||||
<div class="mobile-info">
|
||||
<?=$left_mobail_3?>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?endif?>
|
||||
<?if (function_exists('krutilka_placement')){
|
||||
echo krutilka_placement( 'mobile-1', 'mobile-info' );
|
||||
echo krutilka_placement( 'mobile-2', 'mobile-info' );
|
||||
echo krutilka_placement( 'mobile-3', 'mobile-info' );
|
||||
}?>
|
||||
|
||||
|
||||
|
||||
@@ -192,17 +144,6 @@ window.yaContextCb.push(()=>{
|
||||
|
||||
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
||||
|
||||
<!-- Yandex.RTB R-A-4145099-4 -->
|
||||
<script>
|
||||
window.yaContextCb.push(()=>{
|
||||
Ya.Context.AdvManager.render({
|
||||
"blockId": "R-A-4145099-4",
|
||||
"type": "floorAd",
|
||||
"platform": "touch"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<footer id="footer">
|
||||
|
||||
@@ -258,10 +199,14 @@ window.yaContextCb.push(()=>{
|
||||
<?=vij_lang('subscript_btn', LANG_VERSION);?> </button>
|
||||
</div>
|
||||
|
||||
<?php get_template_part('partials/social_footer'); ?>
|
||||
<?php //get_template_part('partials/social_footer'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="socials-footer">
|
||||
<?php include get_template_directory().'/partials/social-vij.php';?>
|
||||
</div>
|
||||
|
||||
<div id="footer_2">
|
||||
<div id="copy">© <?=vij_lang('copyright', LANG_VERSION);?> <?=date('Y')?></div>
|
||||
<div>
|
||||
@@ -324,6 +269,8 @@ document.write('<img src="'+pr+'?uid=18820&ref='+r+'&rd='+rd+'" width="88" heigh
|
||||
|
||||
<?php get_template_part( 'partials/formhash' );?>
|
||||
|
||||
<?php //include get_template_directory().'/partials/bitrix-form.php';?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -108,12 +108,27 @@ require get_template_directory().'/src/calendar.php';
|
||||
require get_template_directory().'/src/perevod.php';
|
||||
require get_template_directory().'/lang.php'; // функции перевода
|
||||
require get_template_directory().'/src/number-pdf.php'; // загрузка PDF номера
|
||||
require get_template_directory().'/src/journal_issue.php'; // загрузка журнала Питомцы
|
||||
|
||||
require get_template_directory().'/src/dznews.php'; // добавить в Дзен Новости
|
||||
|
||||
|
||||
//require get_template_directory().'/blocks/card_post_id.php';
|
||||
|
||||
add_post_type_support('post', 'page-attributes');
|
||||
|
||||
//для котов
|
||||
require get_template_directory().'/cats/cats-type.php'; // кошки
|
||||
require get_template_directory().'/cats/cats-redirect.php'; // кошки
|
||||
|
||||
function add_google_fonts() {
|
||||
wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap&display=swap');
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'add_google_fonts');
|
||||
|
||||
//require ABSPATH.'vendor/masterforweb/db_lite/db_lite.php';
|
||||
|
||||
|
||||
//[_site_admin_email]
|
||||
/**
|
||||
function vij_send_smtp_email( PHPMailer $phpmailer ) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||
<meta name="yandex-verification" content="22f98955910722f8" />
|
||||
<meta name="zen-verification" content="9Ui9YzVJgKUB7bIgRNnAZqdHCNI8v9REm3TDpW0kciEicYyuD640moNznBDbFqcT" />
|
||||
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
|
||||
@@ -40,9 +40,7 @@
|
||||
<?endif?>
|
||||
<?php wp_head();?>
|
||||
|
||||
<!-- Yandex.RTB -->
|
||||
<script>window.yaContextCb=window.yaContextCb||[]</script>
|
||||
<script src="https://yandex.ru/ads/system/context.js" async></script>
|
||||
|
||||
<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
|
||||
@@ -1,46 +1,166 @@
|
||||
<?php
|
||||
|
||||
function number_info($title, $post_id = 0) {
|
||||
|
||||
$res = [];
|
||||
|
||||
$items = explode(' ', $title);
|
||||
|
||||
$res['year'] = $items[4];
|
||||
$res['number'] = $number;
|
||||
// Инициализируем переменные
|
||||
$res['year'] = isset($items[4]) ? $items[4] : '';
|
||||
$res['number'] = '';
|
||||
$res['guid'] = '';
|
||||
|
||||
// Проверяем PDF в метаполях
|
||||
$pdf_url = get_post_meta($post_id, '_pdf_file', true);
|
||||
if ($pdf_url) {
|
||||
$res['guid'] = esc_url($pdf_url);
|
||||
return $res;
|
||||
}
|
||||
|
||||
$number = substr($items[2], 1, strlen($items[2]) - 2);
|
||||
$name = 'vizh_'.$number.'_'.ru2enmonths($items[3]).'_'.$items[4];
|
||||
|
||||
//echo '<p>'.$name.'</p>';
|
||||
|
||||
$findpdf = db_get("SELECT * FROM `wp_posts` WHERE `post_name` = '$name' ORDER BY `post_modified` DESC LIMIT 1");
|
||||
//echo "SELECT * FROM `wp_posts` WHERE `post_name` = '$name' ORDER BY `post_modified` DESC LIMIT 1";
|
||||
|
||||
if (isset($findpdf['guid'])){
|
||||
$res['guid'] = $findpdf['guid'];
|
||||
// Извлекаем номер
|
||||
if (isset($items[2])) {
|
||||
$res['number'] = substr($items[2], 1, strlen($items[2]) - 2);
|
||||
}
|
||||
|
||||
// Формируем имя для поиска
|
||||
$month = isset($items[3]) ? ru2enmonths($items[3]) : '';
|
||||
$year = isset($items[4]) ? $items[4] : '';
|
||||
|
||||
if ($res['number'] && $month && $year) {
|
||||
$name = 'vizh_' . $res['number'] . '_' . $month . '_' . $year;
|
||||
|
||||
// Используем стандартные методы WordPress для поиска поста
|
||||
$findpdf = get_posts([
|
||||
'name' => $name,
|
||||
'post_type' => 'attachment',
|
||||
'post_status' => 'inherit',
|
||||
'post_mime_type' => 'application/pdf',
|
||||
'posts_per_page' => 1,
|
||||
'orderby' => 'post_modified',
|
||||
'order' => 'DESC'
|
||||
]);
|
||||
|
||||
if (!empty($findpdf)) {
|
||||
$post = $findpdf[0];
|
||||
$res['guid'] = get_the_guid($post->ID);
|
||||
|
||||
// Альтернативно можно получить URL через permalink
|
||||
// $res['guid'] = get_permalink($post->ID);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
||||
}
|
||||
|
||||
// Альтернативная версия с использованием WP_Query
|
||||
function number_info_alt($title, $post_id = 0) {
|
||||
$res = [];
|
||||
|
||||
$items = explode(' ', $title);
|
||||
|
||||
$res['year'] = isset($items[4]) ? $items[4] : '';
|
||||
$res['number'] = '';
|
||||
$res['guid'] = '';
|
||||
|
||||
// Проверяем PDF в метаполях
|
||||
$pdf_url = get_post_meta($post_id, '_pdf_file', true);
|
||||
if ($pdf_url) {
|
||||
$res['guid'] = esc_url($pdf_url);
|
||||
return $res;
|
||||
}
|
||||
|
||||
// Извлекаем номер
|
||||
if (isset($items[2])) {
|
||||
$res['number'] = substr($items[2], 1, strlen($items[2]) - 2);
|
||||
}
|
||||
|
||||
// Формируем имя для поиска
|
||||
$month = isset($items[3]) ? ru2enmonths($items[3]) : '';
|
||||
$year = isset($items[4]) ? $items[4] : '';
|
||||
|
||||
if ($res['number'] && $month && $year) {
|
||||
$name = 'vizh_' . $res['number'] . '_' . $month . '_' . $year;
|
||||
|
||||
// Используем WP_Query для более гибкого поиска
|
||||
$query = new WP_Query([
|
||||
'name' => $name,
|
||||
'post_type' => 'any',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1,
|
||||
'orderby' => 'modified',
|
||||
'order' => 'DESC'
|
||||
]);
|
||||
|
||||
if ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$res['guid'] = get_the_guid();
|
||||
wp_reset_postdata();
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function ru2enmonths($str) {
|
||||
|
||||
$ruMonths = ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'];
|
||||
$enMonths = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];
|
||||
$ruMonths = [
|
||||
'январь', 'февраль', 'март', 'апрель', 'май', 'июнь',
|
||||
'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'
|
||||
];
|
||||
$enMonths = [
|
||||
'january', 'february', 'march', 'april', 'may', 'june',
|
||||
'july', 'august', 'september', 'october', 'november', 'december'
|
||||
];
|
||||
|
||||
$enDate = str_ireplace($ruMonths, $enMonths, $str);
|
||||
|
||||
return $enDate;
|
||||
|
||||
}
|
||||
|
||||
// Еще более безопасная версия с проверкой slug
|
||||
function number_info_safe($title, $post_id = 0) {
|
||||
$res = [
|
||||
'year' => '',
|
||||
'number' => '',
|
||||
'guid' => ''
|
||||
];
|
||||
|
||||
$items = explode(' ', $title);
|
||||
|
||||
// Проверяем PDF в метаполях
|
||||
$pdf_url = get_post_meta($post_id, '_pdf_file', true);
|
||||
if ($pdf_url) {
|
||||
$res['guid'] = esc_url($pdf_url);
|
||||
return $res;
|
||||
}
|
||||
|
||||
// Безопасное извлечение данных
|
||||
if (count($items) >= 5) {
|
||||
$res['year'] = sanitize_text_field($items[4]);
|
||||
|
||||
if (isset($items[2])) {
|
||||
$res['number'] = substr($items[2], 1, strlen($items[2]) - 2);
|
||||
}
|
||||
|
||||
$month = ru2enmonths($items[3]);
|
||||
$name = 'vizh_' . $res['number'] . '_' . $month . '_' . $res['year'];
|
||||
|
||||
// Ищем пост по slug
|
||||
$args = [
|
||||
'name' => $name,
|
||||
'post_type' => 'any',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1,
|
||||
'orderby' => 'modified',
|
||||
'order' => 'DESC'
|
||||
];
|
||||
|
||||
$posts = get_posts($args);
|
||||
|
||||
if (!empty($posts)) {
|
||||
$post = $posts[0];
|
||||
$res['guid'] = get_permalink($post->ID); // Лучше использовать permalink чем guid
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
11
page.php
11
page.php
@@ -28,6 +28,17 @@
|
||||
<?the_content();?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
if ( is_page( array( 39828 ) ) ){
|
||||
get_template_part('blocks/moread_all', null, array(
|
||||
'posts_limit' => 6,
|
||||
'category_id' => 2
|
||||
));
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -20,25 +20,17 @@ function create_rss_yandex(){
|
||||
|
||||
$posts = get_posts( array(
|
||||
'numberposts' => 20,
|
||||
'category' => 2,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'include' => array(),
|
||||
'exclude' => array(),
|
||||
'meta_key' => '',
|
||||
'meta_value' =>'',
|
||||
'post_type' => 'post',
|
||||
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
||||
'suppress_filters' => true,
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => '_erid_token',
|
||||
'value' => '',
|
||||
'key' => '_send_to_zen_news',
|
||||
'value' => '1',
|
||||
'compare' => '='
|
||||
),
|
||||
array(
|
||||
'key' => '_erid_token',
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
91
single-3.php
91
single-3.php
@@ -52,33 +52,43 @@ get_header();?>
|
||||
<?endif?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?$posts = get_posts([
|
||||
|
||||
// Обработка ошибки в функции get_posts() с тегом
|
||||
try {
|
||||
$posts = get_posts([
|
||||
'tag' => 'номер'.$curr_number['number'],
|
||||
'post_type' => 'post',
|
||||
'numberposts' => -1
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
// Логируем ошибку и используем альтернативный подход
|
||||
error_log('Error in get_posts with tag: ' . $e->getMessage());
|
||||
|
||||
// Альтернативный способ получения постов по тегу
|
||||
$tag = get_term_by('name', 'номер'.$curr_number['number'], 'post_tag');
|
||||
if ($tag) {
|
||||
$posts = get_posts([
|
||||
'tag_id' => $tag->term_id,
|
||||
'post_type' => 'post',
|
||||
'numberposts' => -1
|
||||
]);
|
||||
} else {
|
||||
$posts = [];
|
||||
}
|
||||
}
|
||||
|
||||
$pitems = [];
|
||||
$endpolosa = 1;
|
||||
|
||||
if (!empty($posts)) {
|
||||
|
||||
foreach ($posts as $post) {
|
||||
|
||||
$posttags = get_the_tags($post->ID);
|
||||
|
||||
if ($posttags) {
|
||||
foreach ($posttags as $tag) {
|
||||
$pfind = strpos($tag->name, 'полоса');
|
||||
|
||||
if ($pfind !== false) {
|
||||
|
||||
$number = (int)substr($tag->name, 0, $pfind);
|
||||
|
||||
if ($number > $endpolosa) {
|
||||
@@ -87,50 +97,67 @@ get_header();?>
|
||||
$pitems[$number][] = $post;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?for ($i = 1; $i <= $endpolosa; $i++) {?>
|
||||
<?if (isset($pitems[$i])):?>
|
||||
<!--<h2 class="part_title">Полоса <?=$i?></h2>-->
|
||||
<?foreach($pitems[$i] as $item):?>
|
||||
<?$category = get_the_category($item->ID);
|
||||
<?php for ($i = 1; $i <= $endpolosa; $i++) { ?>
|
||||
<?php if (isset($pitems[$i])): ?>
|
||||
<!--<h2 class="part_title">Полоса <?php echo $i; ?></h2>-->
|
||||
<?php foreach($pitems[$i] as $item): ?>
|
||||
<?php
|
||||
$category = get_the_category($item->ID);
|
||||
$category_id = $category[0]->term_id;
|
||||
$category_link = get_category_link($category_id);?>
|
||||
$category_link = get_category_link($category_id);
|
||||
?>
|
||||
|
||||
<div class="main-card">
|
||||
<?if ( has_post_thumbnail($item->ID) ) :?>
|
||||
<?php if (has_post_thumbnail($item->ID)) : ?>
|
||||
<div class="polosa-img">
|
||||
<a href="<?the_permalink($item->ID);?>"><img src="<?php echo get_the_post_thumbnail_url($item->ID, 'large'); ?>" alt="<?=$item->title;?>"></a>
|
||||
<a href="<?php the_permalink($item->ID); ?>">
|
||||
<img src="<?php echo get_the_post_thumbnail_url($item->ID, 'large'); ?>" alt="<?php echo esc_attr($item->post_title); ?>">
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
<div class="main-card-title">
|
||||
<p>
|
||||
<a href="<?php the_permalink($item->ID); ?>">
|
||||
<?php echo get_the_title($item->ID); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<?endif?><br>
|
||||
<div class="main-card-title"><p><a href="<?the_permalink($item->ID);?>"><?=get_the_title($item->ID);?></a></p></div>
|
||||
<div class="main-card-body">
|
||||
<div><a href="<?the_permalink($item->ID);?>"><?=$item->post_excerpt?></a></div><br>
|
||||
<div class="news_date"><a href="<?=$category_link?>"><?=$category['0']->name?></a></div>
|
||||
<div>
|
||||
<a href="<?php the_permalink($item->ID); ?>">
|
||||
<?php echo $item->post_excerpt; ?>
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news_date">
|
||||
<a href="<?php echo $category_link; ?>">
|
||||
<?php echo $category[0]->name; ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?endforeach?>
|
||||
<?endif?>
|
||||
<?}
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$numbers_year = date('Y');
|
||||
include get_template_directory().'/blocks/arh_more.php';
|
||||
?>
|
||||
|
||||
<div class="publ-to-main">
|
||||
<button class="more_button" onclick="location.href='<?=get_site_url()?>/category/arkhiv'" type="button">
|
||||
Архив номеров</button>
|
||||
<button class="more_button" onclick="location.href='<?php echo get_site_url(); ?>/category/arkhiv'" type="button">
|
||||
Архив номеров
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -74,25 +74,6 @@
|
||||
|
||||
|
||||
|
||||
<!-- Yandex.RTB R-A-4145099-6 -->
|
||||
<div id="yandex_rtb_R-A-4145099-6"></div>
|
||||
<script>
|
||||
window.yaContextCb.push(()=>{
|
||||
Ya.Context.AdvManager.render({
|
||||
"blockId": "R-A-4145099-6",
|
||||
"renderTo": "yandex_rtb_R-A-4145099-6"
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<div id="unit_102382"><a href="https://smi2.ru/" >Новости СМИ2</a></div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
(function() {
|
||||
var sc = document.createElement('script'); sc.type = 'text/javascript'; sc.async = true;
|
||||
sc.src = '//smi2.ru/data/js/102382.js'; sc.charset = 'utf-8';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sc, s);
|
||||
}());
|
||||
</script>
|
||||
|
||||
|
||||
<?php include get_template_directory().'/blocks/yets.php';?>
|
||||
|
||||
27
single.php
27
single.php
@@ -11,7 +11,7 @@
|
||||
|
||||
if ($post_categories && !is_wp_error($post_categories)) {
|
||||
foreach ($post_categories as $post_category) {
|
||||
if ($post_category->parent == $pets_category->term_id) {
|
||||
if ($post_category->parent == $pets_category->term_id OR $post_category->term_id == $pets_category->term_id ) {
|
||||
$pets_cat = true;
|
||||
$category_id = $post_category->term_id;
|
||||
$category_name = $post_category->name;
|
||||
@@ -47,6 +47,7 @@ if ( $pets_cat ){
|
||||
|
||||
|
||||
if ( $pets_cat ):?>
|
||||
|
||||
<?echo "<!-- pets: $category_name-->"?>
|
||||
<ul id="nav_content">
|
||||
<li><a href="<?=get_site_url()?>/category/pets">Питомцы</li>
|
||||
@@ -55,6 +56,22 @@ if ( $pets_cat ){
|
||||
<li>-<li>
|
||||
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
|
||||
</ul>
|
||||
<?$categories = get_the_category();
|
||||
if (count($categories) > 1 ){
|
||||
if (!empty($categories)){
|
||||
$category_links = '';
|
||||
foreach ($categories as $cat) {
|
||||
if ($cat->name == 'Новости' or $cat->name == 'События'){
|
||||
continue;
|
||||
}
|
||||
if ($category_links !== ''){
|
||||
$category_links .= ', ';
|
||||
}
|
||||
$category_item = get_category_link($cat->term_id);
|
||||
$category_links .= '<a href="' . $category_item . '">' . $cat->name . '</a>';
|
||||
}
|
||||
}
|
||||
}?>
|
||||
<?else:
|
||||
$category = get_the_category();
|
||||
$category_id = $category[0]->term_id;
|
||||
@@ -73,7 +90,13 @@ if ( $pets_cat ){
|
||||
|
||||
<div class="post_info">
|
||||
<div class="post_info_sub">
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category_name;?></a></span>, <nobr><?php the_time('j F Y, G:i');?></nobr>
|
||||
<?if (isset( $category_links )):?>
|
||||
<span class="post_link_category"><?php echo $category_links; ?></span>
|
||||
<?else:?>
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category_name;?></a></span>
|
||||
<?endif?>
|
||||
<?if ( $category_name == ''){ echo ', '; } ?>
|
||||
<nobr><?php the_time('j F Y, G:i');?></nobr>
|
||||
</div>
|
||||
<div class="post_info_sub post_info_social">
|
||||
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||
|
||||
@@ -33,8 +33,8 @@ add_action( 'wp_enqueue_scripts', function () {
|
||||
$style_ver = filemtime(get_template_directory() . $fstyle);
|
||||
$script_ver = filemtime(get_template_directory() . $fscript);
|
||||
|
||||
wp_enqueue_style('vij-style', get_template_directory_uri() . $fstyle, array(), $style_ver.'17');
|
||||
wp_enqueue_script('vij-script', get_template_directory_uri() . $fscript, array(), $script_ver.'10', 5);
|
||||
wp_enqueue_style('vij-style', get_template_directory_uri() . $fstyle, array(), $style_ver);
|
||||
wp_enqueue_script('vij-script', get_template_directory_uri() . $fscript, array(), $script_ver);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user