delete adv

This commit is contained in:
argoexpert press
2024-05-06 12:02:48 +03:00
parent 4f99b398ba
commit 51d7df598b
9 changed files with 41 additions and 52 deletions

View File

@@ -1,12 +1,15 @@
<?php <?php
get_header(); get_header();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts = new WP_Query([ $posts = new WP_Query([
'category_name' => get_queried_object()->slug, 'category_name' => get_queried_object()->slug,
'post_type' => 'post', 'post_type' => 'post',
'posts_per_page' => 10, 'posts_per_page' => 10,
'orderby' => 'date', 'orderby' => 'date',
'order' => 'ASC' 'order' => 'ASC',
'paged' => $paged
]); ]);
?> ?>
<div class="content-middle articles-wrapper"> <div class="content-middle articles-wrapper">

View File

@@ -21,8 +21,10 @@ $partners = new WP_Query([
$partners->the_post(); $partners->the_post();
?> ?>
<a href="<?= get_permalink(); ?>" class="partner-item"> <a href="<?= get_permalink(); ?>" class="partner-item">
<div class="partner-item__image-container"> <div>
<?= show_post_image(); ?> <?if ( has_post_thumbnail() ) {
the_post_thumbnail( 'thumbnail' ); // Это выведет самую маленькую превьюшку
}?>
</div> </div>
<div class="partner-item__text-container"> <div class="partner-item__text-container">
<p class="subtitle-16"><?= get_the_title(); ?></p> <p class="subtitle-16"><?= get_the_title(); ?></p>

View File

@@ -2,31 +2,34 @@
$posts->the_post(); $posts->the_post();
?> ?>
<div class="event-item"> <div class="event-item">
<a href="<?= the_permalink() ?>"> <!-- <a href="<?= the_permalink() ?>">
<div class="event-item__image-container"> <div class="event-item__image-container">
<?= show_post_image(); ?> <?//= show_post_image(); ?>
<div class="event-item__heading"> <div class="event-item__heading">
<h2 class="event-item__title"><?= the_title() ?></h2> <h2 class="event-item__title"><?= the_title() ?></h2>
<? if (!empty(get_field('subtitle'))) : ?><p class="event-item__subtitle"><?= get_field('subtitle') ?></p><? endif; ?> <? if (!empty(get_field('subtitle'))) : ?><p class="event-item__subtitle"><?= get_field('subtitle') ?></p><? endif; ?>
</div> </div>
</div> </div>
</a> </a>-->
<div class="event-item__text"> <div class="event-item__text">
<div class="event-item__description-block"> <!--<div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Организатор</h3> <h3 class="event-item__description-header subtitle-13">Организатор</h3>
<p class="event-item__description-text text-13"><?= get_field('organizer') ?></p> <p class="event-item__description-text text-13"><?= get_field('organizer') ?></p>
</div> </div>-->
<div class="event-item__description-block"> <!--<div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Дата</h3> <h3 class="event-item__description-header subtitle-13">Дата</h3>
<p class="event-item__description-text text-13"><?= get_field('event_date') ?></p> <p class="event-item__description-text text-13"><?= get_field('event_date') ?></p>
</div> </div>-->
<div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13" style="font-size: 1.2em;"><a href="<?= the_permalink() ?>"><?= the_title()?></a></h3>
</div>
<div class="event-item__description-block"> <div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Место проведения</h3> <h3 class="event-item__description-header subtitle-13">Место проведения</h3>
<p class="event-item__description-text text-13"><?= get_field('location') ?></p> <p class="event-item__description-text text-13"><?= get_field('location') ?></p>
</div> </div>
<div class="event-item__description-block"> <div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">О конференции</h3> <h3 class="event-item__description-header subtitle-13">О конференции</h3>
<p class="event-item__description-text text-13"><? the_excerpt(); ?></p> <p class="event-item__description-text text-13"><a href="<?= the_permalink() ?>"><? the_excerpt(); ?></a></p>
</div> </div>
<div class="event-item__description-block"> <div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Телефон</h3> <h3 class="event-item__description-header subtitle-13">Телефон</h3>

View File

@@ -498,7 +498,7 @@ function auto_add_category_by_slug_to_new_post($post_ID, $post, $update)
wp_set_post_categories($post_ID, array($category->term_id), true); wp_set_post_categories($post_ID, array($category->term_id), true);
} }
} }
add_action('save_post', 'auto_add_category_by_slug_to_new_post', 10, 3); //add_action('save_post', 'auto_add_category_by_slug_to_new_post', 10, 3);
function get_category_name($post = null) function get_category_name($post = null)
@@ -672,7 +672,7 @@ function last_sticky_post() {
} }
// отправка писем через свой почтовый сервис
function agroxpert_send_smtp_email( $phpmailer ) { function agroxpert_send_smtp_email( $phpmailer ) {
$phpmailer->isSMTP(); $phpmailer->isSMTP();

View File

@@ -2,14 +2,15 @@
global $wpdb; // Глобальная переменная для работы с базой данных global $wpdb; // Глобальная переменная для работы с базой данных
// Запрос для получения ID топ-3 просматриваемых постов // Запрос для получения ID топ-3 просматриваемых постов
$query = " $query = $wpdb->prepare("
SELECT p.ID, p.post_title, pv.count SELECT p.ID, p.post_title, p.post_content, m.meta_value AS position
FROM {$wpdb->prefix}posts p FROM $wpdb->posts p
JOIN {$wpdb->prefix}post_views pv ON p.ID = pv.id AND pv.type = 4 INNER JOIN $wpdb->postmeta m ON p.ID = m.post_id
WHERE p.post_status = 'publish' AND p.post_type = 'post' WHERE p.post_type = 'post'
ORDER BY pv.count DESC AND m.meta_key = 'top_participation_position'
LIMIT 3; AND m.meta_value != ''
"; ORDER BY CAST(m.meta_value AS UNSIGNED) ASC
");
$top_posts = $wpdb->get_results($query); $top_posts = $wpdb->get_results($query);

View File

@@ -7,23 +7,12 @@
<?php endif; ?> <?php endif; ?>
<?php if (is_active_sidebar('left-sidebar')) : ?> <?php if (is_active_sidebar('left-sidebar')) : ?>
<?php //dynamic_sidebar('left-sidebar'); ?> <?php dynamic_sidebar('left-sidebar'); ?>
<?php endif; ?> <?php endif; ?>
<?php get_template_part('partials/latest-interview-post'); ?> <?php get_template_part('partials/latest-interview-post'); ?>
<!-- Yandex.RTB R-A-7761284-3 -->
<div id="yandex_rtb_R-A-7761284-3"></div>
<script>
window.yaContextCb.push(()=>{
Ya.Context.AdvManager.render({
"blockId": "R-A-7761284-3",
"renderTo": "yandex_rtb_R-A-7761284-3"
})
})
</script>
<?php if (is_front_page()) : ?> <?php if (is_front_page()) : ?>
<div class="most-read mobile"> <div class="most-read mobile">
<div class="most-read__inner"> <div class="most-read__inner">

View File

@@ -14,10 +14,10 @@ $categoryLink = get_queried_object()->slug;
<h3 class="event-item__description-header subtitle-13">Организатор</h3> <h3 class="event-item__description-header subtitle-13">Организатор</h3>
<p class="event-item__description-text text-13"><?= get_field('organizer') ?></p> <p class="event-item__description-text text-13"><?= get_field('organizer') ?></p>
</div> </div>
<div class="event-item__description-block"> <!--<div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Дата</h3> <h3 class="event-item__description-header subtitle-13">Дата</h3>
<p class="event-item__description-text text-13"><?= get_field('event_date') ?></p> <p class="event-item__description-text text-13"><?= get_field('event_date') ?></p>
</div> </div>-->
<div class="event-item__description-block"> <div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">Место проведения</h3> <h3 class="event-item__description-header subtitle-13">Место проведения</h3>
<p class="event-item__description-text text-13"><?= get_field('location') ?></p> <p class="event-item__description-text text-13"><?= get_field('location') ?></p>
@@ -29,21 +29,21 @@ $categoryLink = get_queried_object()->slug;
</div> </div>
<div class="event-item__description-block"> <div class="event-item__description-block">
<h3 class="event-item__description-header subtitle-13">О конференции</h3> <h3 class="event-item__description-header subtitle-13">О мероприятии</h3>
<p class="event-item__description-text text-13"><? the_content(); ?></p> <p class="event-item__description-text text-13"><? the_content(); ?></p>
</div> </div>
</div> </div>
<div class="event-item__image-container"> <!--<div class="event-item__image-container">
<?= show_post_image(); ?> <?//= show_post_image(); ?>
<div class="event-item__heading"> <div class="event-item__heading">
<h2 class="event-item__title"><?= the_title() ?></h2> <h2 class="event-item__title"><?= the_title() ?></h2>
<? if (!empty(get_field('subtitle'))) : ?><p class="event-item__subtitle"><?= get_field('subtitle') ?></p><? endif; ?> <? if (!empty(get_field('subtitle'))) : ?><p class="event-item__subtitle"><?= get_field('subtitle') ?></p><? endif; ?>
</div> </div>
</div> </div>-->
</div> </div>
<a href="/materialy/<?= $categoryLink; ?>/" class="articles-preview__show-next">Все мероприятия</a> <a href="/events" class="articles-preview__show-next">Все мероприятия</a>
<div class="articles__spacer-container"> <div class="articles__spacer-container">
<div class="articles__spacer"></div> <div class="articles__spacer"></div>
<div class="articles__spacer"></div> <div class="articles__spacer"></div>

View File

@@ -44,16 +44,7 @@
<div class="article-social">Подписывайтесь на нас в <a href="https://dzen.ru/agroexpert_press?favid=254170145" target="_blank">Дзен</a> и <a href="https://t.me/agroexpert_press" target="_blank">Telegram</a></div> <div class="article-social">Подписывайтесь на нас в <a href="https://dzen.ru/agroexpert_press?favid=254170145" target="_blank">Дзен</a> и <a href="https://t.me/agroexpert_press" target="_blank">Telegram</a></div>
</div> </div>
</div> </div>
<!-- Yandex.RTB R-A-7761284-2 -->
<div id="yandex_rtb_R-A-7761284-2"></div>
<script>
window.yaContextCb.push(()=>{
Ya.Context.AdvManager.render({
"blockId": "R-A-7761284-2",
"renderTo": "yandex_rtb_R-A-7761284-2"
})
})
</script>
<?php get_template_part('partials/featured-posts'); ?> <?php get_template_part('partials/featured-posts'); ?>
<?php if (!in_category('partners')) : ?> <?php if (!in_category('partners')) : ?>
<?php get_template_part('partials/related-posts'); ?> <?php get_template_part('partials/related-posts'); ?>

View File

@@ -30,9 +30,9 @@
$formatted_date = format_event_date(); $formatted_date = format_event_date();
?> ?>
<div class="upcoming-event"> <div class="upcoming-event">
<div class="article-time"> <!--<div class="article-time">
<img src="<?= get_asset('/icons/time.svg'); ?>" alt="" /><?php echo $formatted_date; ?> <img src="<?= get_asset('/icons/time.svg'); ?>" alt="" /><?php echo $formatted_date; ?>
</div> </div>-->
<a class="link" href="<?php the_permalink(); ?>"> <a class="link" href="<?php the_permalink(); ?>">
<?php the_title(); ?> <?php the_title(); ?>
</a> </a>