delete prefix category

This commit is contained in:
2024-05-29 10:19:39 +03:00
parent ed1a9bcb7b
commit 7282dfb814
8 changed files with 141 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
<?php include TEMPLATEPATH.'/blocks/gamburger-pets.php'; ?> <?php include TEMPLATEPATH.'/blocks/gamburger-pets.php'; ?>
<div id="petslogo"> <div id="petslogo">
<a href="<?=home_url();?>/category/pets"> <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/logo-pets.svg" alt="Питомцы. Все о домашних животных">
</a> </a>
</div> </div>
@@ -51,12 +51,22 @@
<ul class="header-social-pets"> <ul class="header-social-pets">
<li>
<a href="https://www.youtube.com/@24Allaboutpets" title="Youtube" 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 fill-rule="evenodd" clip-rule="evenodd" d="M12.0568 26.5864C11.7002 26.478 11.3748 26.2853 11.1081 26.0245C10.8415 25.7637 10.6413 25.4424 10.5245 25.0878C9.8572 23.2549 9.65948 15.6011 10.9446 14.0902C11.3724 13.5987 11.9763 13.2961 12.6252 13.248C16.0729 12.8765 26.725 12.926 27.9484 13.3719C28.2924 13.4838 28.6068 13.6722 28.8679 13.9232C29.129 14.1741 29.33 14.481 29.456 14.8209C30.185 16.7158 30.2097 23.6016 29.3571 25.4222C29.1309 25.8961 28.7522 26.28 28.282 26.5121C26.9968 27.1561 13.7621 27.1437 12.0568 26.5864ZM17.5311 22.9948L23.7098 19.7748L17.5311 16.53V22.9948Z" fill="#7A7A7A"/>
</svg>
</a>
</li>
<li> <li>
<a href="https://t.me/pitomcy_vetandlife" title="Telegram" target="_blank"> <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"> <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"/> <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"/> <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> </svg>
</a>
</li> </li>
<li> <li>

View File

@@ -36,6 +36,12 @@
</a> </a>
</div> </div>
<div class="right-info">
<a href="https://www.youtube.com/@24Allaboutpets" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2024/05/pets_480.jpg" width="240" height="200" />
</a>
</div>
<div class="right-info"> <div class="right-info">
<!-- Yandex.RTB R-A-4145099-1 --> <!-- Yandex.RTB R-A-4145099-1 -->
<div id="yandex_rtb_R-A-4145099-1"></div> <div id="yandex_rtb_R-A-4145099-1"></div>
@@ -244,10 +250,11 @@ window.yaContextCb.push(()=>{
<div class="socials-footer-pets"> <div class="socials-footer-pets">
<a href="https://vk.com/pitomcy_vetandlife" target="_blank"><i style="color: #3B83B5;" class="fab fa-vk"></i></a> <a href="https://www.youtube.com/@24Allaboutpets" target="_blank"><i style="color: red;" class="fab fa-youtube btn_soc"></i></a>
<a href="https://t.me/pitomcy_vetandlife" target="_blank"><i style="color: #3B83B5;" class="fab fa-telegram-plane"></i></a> <a href="https://vk.com/pitomcy_vetandlife" target="_blank"><i style="color: #3B83B5;" class="fab fa-vk btn_soc"></i></a>
<a href="https://ok.ru/pitomcy.vetandlife" title="Одноклассники" target="_blank"> <a href="https://t.me/pitomcy_vetandlife" target="_blank"><i style="color: #3B83B5;" class="fab fa-telegram-plane btn_soc"></i></a>
<!--<a href="https://ok.ru/pitomcy.vetandlife" title="Одноклассники" target="_blank">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="#FFA500" d="M5.85,0C2.6,0,0,2.6,0,5.85S2.6,11.7,5.85,11.7c3.25,0,5.85-2.6,5.85-5.85C11.7,2.6,9.1,0,5.85,0z <path fill="#FFA500" d="M5.85,0C2.6,0,0,2.6,0,5.85S2.6,11.7,5.85,11.7c3.25,0,5.85-2.6,5.85-5.85C11.7,2.6,9.1,0,5.85,0z
M5.8,7.3C5.8,7.3,5.8,7.3,5.8,7.3C4.35,7.2,2.9,5.75,3,4.3c0.1-1.45,1.55-2.9,3-3c1.45,0.1,2.9,1.55,3,3C8.95,5.8,7.5,7.2,5.8,7.3z"/> M5.8,7.3C5.8,7.3,5.8,7.3,5.8,7.3C4.35,7.2,2.9,5.75,3,4.3c0.1-1.45,1.55-2.9,3-3c1.45,0.1,2.9,1.55,3,3C8.95,5.8,7.5,7.2,5.8,7.3z"/>
@@ -256,7 +263,7 @@ window.yaContextCb.push(()=>{
c1.2,0.9,2.6,1.5,4.05,1.8l-3.6,3.7c-0.55,0.55-0.55,1.45,0,2c0.55,0.55,1.45,0.55,2,0v-0.2l3.6-3.3l3.6,3.7 c1.2,0.9,2.6,1.5,4.05,1.8l-3.6,3.7c-0.55,0.55-0.55,1.45,0,2c0.55,0.55,1.45,0.55,2,0v-0.2l3.6-3.3l3.6,3.7
c0.55,0.45,1.35,0.4,2-0.1c0,0,0,0,0,0c0.5-0.45,0.55-1.3,0.1-1.8c-0.05-0.05-0.1-0.1-0.15-0.15L7.8,14.4z"/> c0.55,0.45,1.35,0.4,2-0.1c0,0,0,0,0,0c0.5-0.45,0.55-1.3,0.1-1.8c-0.05-0.05-0.1-0.1-0.15-0.15L7.8,14.4z"/>
</svg> </svg>
</a> </a>-->
</div> </div>
</div> </div>

View File

@@ -7,8 +7,6 @@
<div id="left"> <div id="left">
<?php // include VIJ_CACHE.'leftmenu.html';?> <?php // include VIJ_CACHE.'leftmenu.html';?>
<?php if (LANG_VERSION == 'en'){ <?php if (LANG_VERSION == 'en'){
get_blocks_gen( 'left_menu_en' ); get_blocks_gen( 'left_menu_en' );
@@ -108,6 +106,10 @@ window.yaContextCb.push(()=>{
<? banners_conf_display( 'right_240x400_3' ) ?> <? banners_conf_display( 'right_240x400_3' ) ?>
</div> </div>
<div class="right-info">
<? banners_conf_display( 'right_240x400_4' ) ?>
</div>
<?endif?> <?endif?>
@@ -178,6 +180,10 @@ window.yaContextCb.push(()=>{
<? banners_conf_display( 'right_240x200_3' ) ?> <? banners_conf_display( 'right_240x200_3' ) ?>
</div> </div>
<div class="mobile-info">
<? banners_conf_display( 'right_240x200_4' ) ?>
</div>

View File

@@ -795,6 +795,7 @@ add_filter( 'the_excerpt_rss', 'add_text_to_the_feed_end' );
function add_div_youtube($str){ function add_div_youtube($str){
$content = $str; $content = $str;
@@ -839,7 +840,70 @@ function find_youtube($str) {
} }
add_filter('the_content', 'add_div_youtube');
// Добавляем поле "Завершено" для рубрики "Мероприятия"
function add_completed_meta_box() {
// Убедимся, что мы находимся в админке и редактируем запись
if (is_admin() && isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] === 'edit') {
$post_id = $_GET['post'];
$post_categories = wp_get_post_categories($post_id);
// Проверяем, принадлежит ли запись к рубрике "Мероприятия" (ID = 61)
if (in_array(61, $post_categories)) {
add_meta_box(
'completed_meta_box',
__('Завершено', 'text_domain'),
'completed_meta_box_callback',
'post',
'side',
'high'
);
}
}
}
add_action('add_meta_boxes', 'add_completed_meta_box');
// Функция обратного вызова для вывода поля "Завершено"
function completed_meta_box_callback($post) {
$completed = get_post_meta($post->ID, 'completed', true);
wp_nonce_field(basename(__FILE__), 'completed_nonce');
?>
<label for="completed_checkbox">
<input type="checkbox" id="completed_checkbox" name="completed_checkbox" <?php echo ($completed == 'yes') ? 'checked' : ''; ?>>
<?php _e('Да, мероприятие завершено', 'text_domain'); ?>
</label>
<?php
}
// Сохраняем данные поля "Завершено"
function save_completed_meta_box_data($post_id) {
if (!isset($_POST['completed_nonce']) || !wp_verify_nonce($_POST['completed_nonce'], basename(__FILE__))) {
return;
}
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
if (!current_user_can('edit_post', $post_id)) {
return;
}
if (isset($_POST['completed_checkbox'])) {
update_post_meta($post_id, 'completed', 'yes');
} else {
update_post_meta($post_id, 'completed', 'no');
}
}
add_action('save_post', 'save_completed_meta_box_data');
// обработка youtube
//add_filter('the_content', 'add_div_youtube');
add_filter( 'posts_results', 'set_query_to_draft', null, 2 ); add_filter( 'posts_results', 'set_query_to_draft', null, 2 );

View File

@@ -154,7 +154,7 @@ ul.menu_main_pets{
padding-left: 12px; padding-left: 12px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 60px; gap: 4%;
} }
.footer-mail a{ .footer-mail a{
@@ -165,7 +165,7 @@ ul.menu_main_pets{
.socials-footer-pets{ .socials-footer-pets{
display: inline-flex; display: inline-flex;
align-items: flex-start; align-items: flex-start;
gap: 40px; gap: 5%;
} }
.footer-qrs-pets{ .footer-qrs-pets{
@@ -286,7 +286,7 @@ ul.pets-menu-left{
} }
.socials-footer-pets{ .socials-footer-pets{
gap: 12px; gap: 5%;
} }
#mainbanner { #mainbanner {

View File

@@ -30,9 +30,27 @@
</div> </div>
<div id="fulltext"> <div id="fulltext">
<?// Получаем значение метаполя "completed" для текущей записи
$post_id = get_the_ID();
if ( metadata_exists( 'post', $post_id, 'completed' ) ) {
$completed = get_post_meta($post_id, 'completed', true);
} else {
$completed = false;
}
// Проверяем, установлена ли галочка "Завершено"
if ($completed === 'yes') {
echo '<h1 class="post-h1">'.get_the_title().'</h1>
<p>Мероприятие завершено. Посмотрите <span class="post_link_category"><a href="/category/vystavki-i-konferenitsii">актуальные мероприятия</a></span> или воспользуйтесь нашим поиском.</p>';
} else { ?>
<h1 class="post-h1"><?php wp_title('');?></h1> <h1 class="post-h1"><?php wp_title('');?></h1>
<?$author = get_the_author(); <?$author = get_the_author();
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?> if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
<div class="post_author"> <div class="post_author">
Автор: <?php the_author(); ?> Автор: <?php the_author(); ?>
@@ -48,6 +66,9 @@
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> --> <!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
<?//endwhile;?> <?//endwhile;?>
<?}?>
</div> </div>
<?php include get_template_directory().'/blocks/moread_events.php';?> <?php include get_template_directory().'/blocks/moread_events.php';?>
@@ -69,7 +90,7 @@
<div class="publ-to-main"><a href="https://vetandlife.ru"> <span class="arrow-go-main"><</span>&nbsp;&nbsp;&nbsp;<span class="go-to-main">На главную</span></a></div> <div class="publ-to-main"><a href="https://vetandlife.ru"> <span class="arrow-go-main"><</span>&nbsp;&nbsp;&nbsp;<span class="go-to-main">На главную</span></a></div>
</div> </div>

View File

@@ -85,6 +85,15 @@ window.yaContextCb.push(()=>{
}) })
</script> </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';?> <?php include get_template_directory().'/blocks/yets.php';?>

View File

@@ -139,6 +139,15 @@ window.yaContextCb.push(()=>{
}) })
</script> </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';?> <?php include get_template_directory().'/blocks/yets.php';?>