correct figure captions
This commit is contained in:
@@ -52,23 +52,17 @@
|
||||
'image' => 'https://vetandlife.ru/wp-content/uploads/2021/12/likarchyk.png'
|
||||
], */
|
||||
|
||||
'9' => [
|
||||
'name' => 'Ксения Рахманова',
|
||||
'position' => 'Автор-переводчик',
|
||||
'image' => 'https://vetandlife.ru/wp-content/uploads/2022/09/rakhmanova_107.jpg'
|
||||
],
|
||||
|
||||
'10' => [
|
||||
'name' => 'Александр Плонский',
|
||||
'position' => 'Фотокорреспондент',
|
||||
'image' => 'https://vetandlife.ru/wp-content/uploads/2021/12/plonsky_107.jpg'
|
||||
],
|
||||
|
||||
'11' => [
|
||||
/** '11' => [
|
||||
'name' => 'Алла Орехова',
|
||||
'position' => 'Менеджер по рекламе',
|
||||
'image' => 'https://agroexpert.press/wp-content/uploads/2024/07/alla-orehova.jpg'
|
||||
],
|
||||
], */
|
||||
|
||||
'12' => [
|
||||
'name' => 'Юлия Дерябина',
|
||||
|
||||
@@ -44,9 +44,9 @@ $extensionToClassMap = [
|
||||
<? if ($contacts) : ?>
|
||||
<? foreach ($contacts as $contact) : ?>
|
||||
<div class="advert-item__contact-item">
|
||||
<div class="advert-item__avatar-container"><img src="https://agroexpert.press/wp-content/uploads/2024/07/alla-orehova.jpg" alt="" class="advert-item__contacts-avatar"></div>
|
||||
<!--<div class="advert-item__avatar-container"><img src="https://agroexpert.press/wp-content/uploads/2024/09/polovincev.jpg" alt="Илья Половинцев" class="advert-item__contacts-avatar"></div>-->
|
||||
<div class="advert-item__contact-info">
|
||||
<p class="advert-item__contact-name subtitle-13">Алла Орехова</p>
|
||||
<p class="advert-item__contact-name subtitle-13">Елена Мишина</p>
|
||||
<p class="advert-item__contact-position text-13"><?= $contact['position'] ?></p>
|
||||
<p class="advert-item__contact-phone subtitle-13">Тел: <a href="tel:79263663700"> +7 (926) 366 37 00</a></p>
|
||||
<p class="advert-item__contact-email text-13"><a href="mailto:pr@agroexpert.press">pr@agroexpert.press</a></p>
|
||||
@@ -55,9 +55,10 @@ $extensionToClassMap = [
|
||||
<? endforeach; ?>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<?/** echo '
|
||||
<div class="advert_download">
|
||||
<a class="button btn_download" href="https://agroexpert.press/wp-content/uploads/2024/08/agroexpress_mediakit.pdf" target="_blank">Скачать медиакит</a>
|
||||
</div>
|
||||
</div>';*/?>
|
||||
</div>
|
||||
</div>
|
||||
<? endwhile; ?>
|
||||
|
||||
@@ -6,7 +6,6 @@ $class = $full_width ? 'article-item article-item--lg' : 'article-item';
|
||||
<div class="<?= $class; ?>">
|
||||
<a href="<?php the_permalink(); ?>" class="article-item__image-container">
|
||||
<?= show_post_image(); ?>
|
||||
<div class="tag article-item__tag"><?=get_category_name(); ?></div>
|
||||
</a>
|
||||
<div class="article-item__text">
|
||||
<div class="article-time">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<footer itemscope itemtype="https://schema.org/WPFooter" class="footer">
|
||||
<div class="footer-top">
|
||||
<div class="container footer__conatiner">
|
||||
<div class="footer-top__inner">
|
||||
|
||||
@@ -76,28 +76,32 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.article-single-img>img,
|
||||
.wp-block-image>img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
object-fit: cover;
|
||||
.article-single-img, .wp-block-image {
|
||||
margin: 0 -2.5rem;
|
||||
position: relative;
|
||||
margin-bottom: 2rem;
|
||||
height: auto;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.article-single-img__text,
|
||||
.wp-element-caption {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 2.5rem;
|
||||
bottom: 2.5rem;
|
||||
.article-single-img img, .wp-block-image img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.article-single-img__text, .wp-element-caption {
|
||||
position: static;
|
||||
display: block;
|
||||
margin-top: 0.5rem;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.6rem;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5rem;
|
||||
background-color: #ffffff;
|
||||
padding: 4px 8px;
|
||||
text-align: center;
|
||||
max-width: 90%; /* Ограничиваем ширину подписи */
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.article-single-img__video {
|
||||
@@ -233,4 +237,20 @@ sup {
|
||||
padding: 0;
|
||||
min-height: unset;
|
||||
}
|
||||
|
||||
.wp-block-image {
|
||||
margin: 0; /* Убираем отрицательный margin */
|
||||
}
|
||||
|
||||
.wp-element-caption {
|
||||
font-size: 1rem; /* Уменьшаем шрифт подписи */
|
||||
line-height: 1.4rem;
|
||||
padding: 2px 6px;
|
||||
max-width: 95%; /* Делаем подпись адаптивной */
|
||||
}
|
||||
|
||||
.article-single-img, .wp-block-image{
|
||||
height: auto;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,10 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 8c3c602de751cb17721311afac451c4109c6924d
|
||||
ul.wp-block-list li{
|
||||
display: block;
|
||||
padding: 4px 0;
|
||||
|
||||
167
functions.php
167
functions.php
@@ -1,11 +1,41 @@
|
||||
<?php
|
||||
setlocale(LC_TIME, 'ru_RU.UTF-8');
|
||||
|
||||
// Полностью отключить XML-RPC
|
||||
add_filter( 'xmlrpc_enabled', '__return_false' );
|
||||
|
||||
// Отключение методов XML-RPC, требующих авторизации
|
||||
add_filter( 'xmlrpc_methods', function( $methods ) {
|
||||
unset( $methods['pingback.ping'] );
|
||||
return $methods;
|
||||
} );
|
||||
|
||||
// Полное отключение REST API
|
||||
add_filter('rest_enabled', '__return_false');
|
||||
add_filter('rest_jsonp_enabled', '__return_false');
|
||||
|
||||
function redirect_non_admin_users() {
|
||||
// Получаем текущего пользователя
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
// Проверяем, если пользователь не является администратором
|
||||
if (in_array('subscriber', $current_user->roles)) {
|
||||
// Если это запрос к административной панели или если пользователь пытается получить доступ к wp-admin
|
||||
if (is_admin()) {
|
||||
// Перенаправляем на главную страницу сайта
|
||||
wp_redirect(home_url());
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('admin_init', 'redirect_non_admin_users');
|
||||
|
||||
|
||||
|
||||
define('ENPART', 740);
|
||||
define('EN_PARTS', '746,741,742,743,744,745');
|
||||
|
||||
require get_template_directory().'/dzenews.php'; //add support dzen
|
||||
// require get_template_directory().'/dzenews.php'; //add support dzen (добавляет поле Экслюзив)
|
||||
|
||||
function theme_setup()
|
||||
{
|
||||
@@ -583,92 +613,75 @@ function get_category_name_en($post = null)
|
||||
}
|
||||
|
||||
|
||||
// Добавляем функцию для формирования мета-тегов страницы
|
||||
function custom_meta_tags() {
|
||||
|
||||
$sitename = get_bloginfo('name');
|
||||
|
||||
$meta_tags = '';
|
||||
$og_tags = '';
|
||||
|
||||
$og_tags .= '<meta property="og:locale" content="ru_RU">';
|
||||
$og_tags .= '<meta property="og:site_name" content="'. $sitename .'">'. PHP_EOL;
|
||||
$og_tags .= '<meta property="og:locale" content="ru_RU">' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:site_name" content="' . esc_html($sitename) . '">' . PHP_EOL;
|
||||
|
||||
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
|
||||
|
||||
// Получаем заголовок страницы
|
||||
if (is_single() || is_page()) {
|
||||
if (is_home() || is_front_page()) {
|
||||
$title = 'Федеральное издание «Агроэксперт» - новости в сфере сельского хозяйства России';
|
||||
$description = get_bloginfo('description');
|
||||
|
||||
$current_url = get_permalink();
|
||||
$meta_tags .= '<title>' . esc_html($title) . '</title>' . PHP_EOL;
|
||||
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:title" content="' . esc_html($title) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />' . PHP_EOL;
|
||||
|
||||
$post = get_post(); // Получаем объект текущего поста или страницы
|
||||
$title = get_the_title($post).' - '.$sitename; // Получаем заголовок текущего поста или страницы
|
||||
$excerpt = get_the_excerpt($post);
|
||||
} elseif (is_category() || is_tag()) {
|
||||
$term = get_queried_object();
|
||||
$canonical_url = get_term_link($term);
|
||||
|
||||
if (has_excerpt()) {
|
||||
$description = $excerpt;
|
||||
} elseif (strlen($excerpt) > 300) {
|
||||
$description = wp_trim_words($excerpt, 30, '...');
|
||||
if ($paged > 1) {
|
||||
$meta_tags .= '<link rel="canonical" href="' . esc_url($canonical_url) . '" />' . PHP_EOL;
|
||||
}
|
||||
|
||||
$title = $term->name . ' - ' . $sitename;
|
||||
$description = !empty(trim($term->description)) ? $term->description : $term->name;
|
||||
|
||||
if ($paged > 1) {
|
||||
$title .= ', страница ' . $paged;
|
||||
$description .= '. Страница ' . $paged;
|
||||
}
|
||||
|
||||
$og_tags .= '<meta property="og:url" content="' . esc_url($canonical_url) . '" />' . PHP_EOL;
|
||||
$meta_tags .= '<title>' . esc_html($title) . '</title>' . PHP_EOL;
|
||||
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:title" content="' . esc_html($title) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />' . PHP_EOL;
|
||||
|
||||
} elseif (is_single() || is_page()) {
|
||||
$post = get_queried_object();
|
||||
|
||||
if (is_page('kontakty')) { //конкретные страницы
|
||||
$title = get_the_title($post).' '. $sitename;
|
||||
} else {
|
||||
$description = $excerpt;
|
||||
$title = get_the_title($post) . ' - ' . $sitename;
|
||||
}
|
||||
|
||||
$tags = get_the_tags($post); // Получаем теги текущего поста или страницы
|
||||
$keywords = ''; // Переменная для хранения ключевых слов
|
||||
if ($tags) {
|
||||
$keywords = implode(', ', wp_list_pluck($tags, 'name')); // Формируем строку с тегами через запятую
|
||||
}
|
||||
$description = has_excerpt($post) ? get_the_excerpt($post) : wp_trim_words(strip_shortcodes($post->post_content), 30);
|
||||
|
||||
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
|
||||
$post_thumbnail_url = wp_get_attachment_image_src($post_thumbnail_id, 'full');
|
||||
if ($post_thumbnail_url) {
|
||||
$og_image = esc_url($post_thumbnail_url[0]);
|
||||
$og_tags .= '<meta property="og:image" content="' . $og_image . '">'. PHP_EOL;
|
||||
$og_tags .= '<meta name="twitter:card" content="summary_large_image">'. PHP_EOL;
|
||||
}
|
||||
$og_tags .= '<meta property="og:url" content="' . esc_url($canonical_url) . '" />' . PHP_EOL;
|
||||
$meta_tags .= '<title>' . esc_html($title) . '</title>' . PHP_EOL;
|
||||
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:title" content="' . esc_html($title) . '" />' . PHP_EOL;
|
||||
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />' . PHP_EOL;
|
||||
|
||||
$og_tags .= '<meta property="og:type" content="article">'. PHP_EOL;
|
||||
|
||||
} elseif (is_category()) {
|
||||
$category = get_queried_object(); // Получаем объект текущей рубрики
|
||||
$current_url = get_term_link($category);
|
||||
$title = $category->name.': Новости, комментарии по теме - '.$sitename; // Получаем название текущей рубрики
|
||||
$description = $category->description; // Получаем описание текущей рубрики
|
||||
$keywords = $category->name; // Ключевые слова - название рубрики
|
||||
} elseif (is_home()) {
|
||||
|
||||
$current_url = get_site_url();
|
||||
|
||||
$title = $sitename; // Получаем название сайта для главной страницы
|
||||
$description = get_bloginfo('description'); // Получаем описание сайта для главной страницы
|
||||
$keywords = ''; // Для главной страницы ключевые слова оставляем пустыми
|
||||
|
||||
$og_tags .= '<meta property="og:type" content="website">'. PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
// Добавляем мета-теги только в случае, если их значения не пусты
|
||||
if (!empty($current_url)) {
|
||||
$og_tags .= '<meta property="og:url" content="' . esc_url($current_url) . '" />' . PHP_EOL;
|
||||
}
|
||||
if (!empty($title)) {
|
||||
$meta_tags .= '<title>' . esc_html($title) . '</title>'. PHP_EOL;
|
||||
$og_tags .= '<meta property="og:title" content="'. esc_html($title) .'" />'. PHP_EOL;
|
||||
}
|
||||
if (!empty($description)) {
|
||||
$description = wp_strip_all_tags($description);
|
||||
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">'. PHP_EOL;
|
||||
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />'. PHP_EOL;
|
||||
}
|
||||
if (!empty($keywords)) {
|
||||
$meta_tags .= '<meta name="keywords" content="' . esc_attr($keywords) . '">'. PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
// Выводим мета-теги
|
||||
echo $meta_tags;
|
||||
echo $og_tags;
|
||||
}
|
||||
|
||||
add_action('wp_head', 'custom_meta_tags');
|
||||
|
||||
|
||||
|
||||
|
||||
add_action('wpcf7_before_send_mail', 'my_custom_contact_form_handler', 10, 3);
|
||||
function my_custom_contact_form_handler($contact_form, $abort, $submission) {
|
||||
@@ -1145,3 +1158,27 @@ function change_author_name($author) {
|
||||
}
|
||||
add_filter('the_author', 'change_author_name');
|
||||
|
||||
// подписчики на главную
|
||||
//add_action('admin_init', 'restrict_subscriber_admin_access');
|
||||
function restrict_subscriber_admin_access() {
|
||||
// Проверяем, что пользователь вошел в систему и имеет роль 'subscriber'
|
||||
if (current_user_can('subscriber')) {
|
||||
// Перенаправляем на главную страницу сайта
|
||||
wp_redirect(home_url());
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//авторы только в черновики
|
||||
function restrict_author_publish_posts( $data ) {
|
||||
// Проверяем, что текущий пользователь - автор
|
||||
if ( current_user_can( 'author' ) && $data['post_status'] == 'publish' ) {
|
||||
// Отключаем публикацию для авторов
|
||||
$data['post_status'] = 'draft'; // Сохраняем как черновик
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
add_filter( 'wp_insert_post_data', 'restrict_author_publish_posts' );
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<?custom_meta_tags();?>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
@@ -53,7 +52,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<div class="container">
|
||||
<div class="header__inner">
|
||||
<?php $site_logo = get_field('site_logo', 'option'); ?>
|
||||
<a href="<?php echo home_url(); ?>/en" class="logo header__logo">
|
||||
<a href="<?php echo home_url(); ?>/en/" class="logo header__logo">
|
||||
<img src="https://agroexpert.press/wp-content/uploads/2024/05/agroexpert_horizontally.svg" alt="agroexpert.press" width="188" />
|
||||
</a>
|
||||
<nav class="nav header__nav">
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
|
||||
<head>
|
||||
<head itemscope itemtype="https://schema.org/WPHeader">
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="zen-verification" content="xdaKRGoPCQTgRYUKZ7tBq2pDm8JxN4zVv8KxInVPCyE11AQGYpdnVL5ocisUY6w7" />
|
||||
<?custom_meta_tags();?>
|
||||
<meta name="google-site-verification" content="wKVjdTPQrw11PE9o4Blxqv7qbdFmxarn8ez4fCJd_po" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
@@ -13,6 +13,7 @@
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="yandex-verification" content="209d13da5a697e41" />
|
||||
<?php wp_head(); ?>
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript" >
|
||||
@@ -79,10 +80,10 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<nav class="nav header__nav">
|
||||
<?php get_template_part('partials/menu-primary'); ?>
|
||||
</nav>
|
||||
<div class="lang-switch"><a href="<?php echo home_url();?>/en">EN</a></div>
|
||||
<div class="lang-switch"><a href="<?php echo home_url();?>/en/">EN</a></div>
|
||||
<div class="header__right">
|
||||
<div class="header__actions">
|
||||
<a href="/search/">
|
||||
<a href="/search/?orderby=post_date&order=desc">
|
||||
<button class="header-action">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_464_1772)">
|
||||
|
||||
@@ -25,11 +25,14 @@ array_push($categories, $firstElement);
|
||||
$icon = get_field('icon', 'category_' . $cat->term_id);
|
||||
$bg_image = get_field('bg_image', 'category_' . $cat->term_id);
|
||||
|
||||
$class = in_array($cat->term_id, $current_term_ids) ? 'is-active' : '';
|
||||
if($bg_image){
|
||||
|
||||
echo "<a href='" . get_category_link($cat->term_id) . "' class='menu-vertical__item " . $class . "'>
|
||||
$class = in_array($cat->term_id, $current_term_ids) ? 'is-active' : '';
|
||||
|
||||
echo "<a href='" . get_category_link($cat->term_id) . "' class='menu-vertical__item " . $class . "'>
|
||||
<span class='menu-vertical__item-icon'><img src='" . $icon . "' alt=''></span>
|
||||
<span class='menu-vertical__item-text'>$cat->name</a></span>
|
||||
</a>
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ foreach ($categories as $category) {
|
||||
$bg_image = get_field('bg_image', 'category_' . $category->term_id);
|
||||
$category_link = get_category_link($category->term_id);
|
||||
?>
|
||||
<?php if ($icon) : ?>
|
||||
<a href="<?php echo esc_url($category_link); ?>" class="menu-link">
|
||||
<div class="menu-link__bg">
|
||||
<?php if ($bg_image) : ?>
|
||||
@@ -30,6 +31,7 @@ foreach ($categories as $category) {
|
||||
</div>
|
||||
<span class="menu-link__text"><?php echo esc_html($category->name); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -19,7 +19,7 @@ if ($pinned_post) :
|
||||
<?php echo get_the_excerpt($pinned_post->ID); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tag hero-banner__tag"><?php echo esc_html(get_category_name($pinned_post)); ?></div>
|
||||
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -1,7 +1,5 @@
|
||||
<div class="content-sidebar">
|
||||
<div class="content-sidebar-top">
|
||||
<div class="content-sidebar__title subtitle-20">Календарь мероприятий</div>
|
||||
<div id="calendar"></div>
|
||||
<div class="upcoming-events">
|
||||
<h3 class="upcoming-events__title subtitle-16">Ближайшие мероприятия</h3>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user