diff --git a/functions.php b/functions.php
index 81d49a7..43aee74 100644
--- a/functions.php
+++ b/functions.php
@@ -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);
}
}
-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)
@@ -672,7 +672,7 @@ function last_sticky_post() {
}
-
+// отправка писем через свой почтовый сервис
function agroxpert_send_smtp_email( $phpmailer ) {
$phpmailer->isSMTP();
diff --git a/partials/most-read-posts.php b/partials/most-read-posts.php
index ba6ce83..82d3a0f 100644
--- a/partials/most-read-posts.php
+++ b/partials/most-read-posts.php
@@ -2,14 +2,15 @@
global $wpdb; // Глобальная переменная для работы с базой данных
// Запрос для получения ID топ-3 просматриваемых постов
-$query = "
- SELECT p.ID, p.post_title, pv.count
- FROM {$wpdb->prefix}posts p
- JOIN {$wpdb->prefix}post_views pv ON p.ID = pv.id AND pv.type = 4
- WHERE p.post_status = 'publish' AND p.post_type = 'post'
- ORDER BY pv.count DESC
- LIMIT 3;
-";
+$query = $wpdb->prepare("
+ SELECT p.ID, p.post_title, p.post_content, m.meta_value AS position
+ FROM $wpdb->posts p
+ INNER JOIN $wpdb->postmeta m ON p.ID = m.post_id
+ WHERE p.post_type = 'post'
+ AND m.meta_key = 'top_participation_position'
+ AND m.meta_value != ''
+ ORDER BY CAST(m.meta_value AS UNSIGNED) ASC
+");
$top_posts = $wpdb->get_results($query);
diff --git a/sidebar-left.php b/sidebar-left.php
index cbfe17c..45e2321 100644
--- a/sidebar-left.php
+++ b/sidebar-left.php
@@ -7,23 +7,12 @@
-
+
-
-
-
-
diff --git a/single-events.php b/single-events.php
index 60c770e..72df703 100644
--- a/single-events.php
+++ b/single-events.php
@@ -14,10 +14,10 @@ $categoryLink = get_queried_object()->slug;
= get_field('organizer') ?>
-
+
= get_field('location') ?>
@@ -29,21 +29,21 @@ $categoryLink = get_queried_object()->slug;
-
- = show_post_image(); ?>
+
-
Все мероприятия
+
Все мероприятия
diff --git a/single.php b/single.php
index c7c511a..0da3e4c 100644
--- a/single.php
+++ b/single.php
@@ -44,16 +44,7 @@
Подписывайтесь на нас в
Дзен и
Telegram
-
-
-
+
diff --git a/widgets/upcoming-events-widget-template.php b/widgets/upcoming-events-widget-template.php
index 82440be..e468fca 100644
--- a/widgets/upcoming-events-widget-template.php
+++ b/widgets/upcoming-events-widget-template.php
@@ -30,9 +30,9 @@
$formatted_date = format_event_date();
?>