parent
92328f81b9
commit
960af33ef3
After Width: | Height: | Size: 1.5 KiB |
@ -1,3 +1,7 @@ |
|||||||
main{ |
main{ |
||||||
padding-top: 72px; |
padding-top: 72px; |
||||||
} |
} |
||||||
|
|
||||||
|
.block-lists_text p { |
||||||
|
font-size: 18px!important; |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
@media(max-width:600px) { |
||||||
|
.article-content h2 { |
||||||
|
max-width: 661px; |
||||||
|
font-size: 24px!important; |
||||||
|
line-height: 40px; |
||||||
|
font-weight: bold; |
||||||
|
text-transform: uppercase; |
||||||
|
color: var(--grey-black); |
||||||
|
} |
||||||
|
} |
@ -1,23 +1,22 @@ |
|||||||
<?php |
<?php |
||||||
|
|
||||||
|
|
||||||
add_filter('timber/context', function($context) { |
add_filter('timber/context', function($context) { |
||||||
$current_category = get_queried_object(); // Получаем текущую категорию |
// Простой запрос для получения последних постов |
||||||
|
|
||||||
$args = array( |
$args = array( |
||||||
'post_type' => 'post', |
'post_type' => 'post', |
||||||
'posts_per_page' => 3, // Количество постов |
'posts_per_page' => 3, |
||||||
'orderby' => 'meta_value_num', |
'orderby' => 'date', |
||||||
'key' => 'post_views', // Поле плагина для подсчёта просмотров |
'order' => 'DESC' |
||||||
'order' => 'DESC', // Сортировка по убыванию |
|
||||||
|
|
||||||
// Условие для фильтрации по текущей категории |
|
||||||
'category__in' => $current_category ? array($current_category->term_id) : '', |
|
||||||
); |
); |
||||||
|
|
||||||
$most_read_query = new WP_Query($args); |
$most_read_query = new WP_Query($args); |
||||||
$most_read = new Timber\PostQuery($most_read_query); |
$most_read = new Timber\PostQuery($most_read_query); |
||||||
|
|
||||||
$context['most_read'] = $most_read; |
$context['most_read'] = $most_read; |
||||||
|
|
||||||
|
// Добавляем отладочную информацию |
||||||
|
global $wpdb; |
||||||
|
$debug_info = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE meta_key LIKE '%view%' LIMIT 5"); |
||||||
|
$context['debug_info'] = $debug_info; |
||||||
|
|
||||||
return $context; |
return $context; |
||||||
}); |
}); |
Loading…
Reference in new issue