add special

This commit is contained in:
argoexpert press
2025-05-29 00:59:59 +03:00
parent f2d7deeedf
commit 1b83816191
13 changed files with 377 additions and 17 deletions

View File

@@ -2,6 +2,7 @@
setlocale(LC_TIME, 'ru_RU.UTF-8');
require get_template_directory() . '/inc/rubrics-menu.php'; // Рубрики в меню
require get_template_directory() . '/inc/special.php'; // Подключаем спецпроекты
require get_template_directory() . '/inc/spravochniki.php'; // Подключаем справочники
// Полностью отключить XML-RPC
@@ -634,7 +635,7 @@ function custom_meta_tags() {
$description = get_bloginfo('description');
$meta_tags .= '<title>' . esc_html($title) . '</title>' . PHP_EOL;
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
$meta_tags .= '<meta itemprop="description" 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;
@@ -655,11 +656,11 @@ function custom_meta_tags() {
}
$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;
$meta_tags .= '<title itemprop="headline">' . esc_html($title) . '</title>' . PHP_EOL;
$meta_tags .= '<meta itemprop="description" 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_author()) {
$author = get_queried_object();
$author_name = $author->display_name;
@@ -670,7 +671,7 @@ function custom_meta_tags() {
$description = !empty($author_description) ? $author_description : 'Материалы, опубликованные автором ' . $author_name;
$meta_tags .= '<title>' . esc_html($title) . '</title>' . PHP_EOL;
$meta_tags .= '<meta name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
$meta_tags .= '<meta itemprop="description" name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
$meta_tags .= '<meta name="author" content="' . esc_attr($author_name) . '">' . PHP_EOL;
$meta_tags .= '<link rel="canonical" href="' . esc_url($canonical_url) . '" />' . PHP_EOL;
@@ -691,8 +692,15 @@ function custom_meta_tags() {
$description = has_excerpt($post) ? get_the_excerpt($post) : wp_trim_words(strip_shortcodes($post->post_content), 30);
$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;
$meta_tags .= '<title itemprop="headline">' . esc_html($title) . '</title>' . PHP_EOL;
$meta_tags .= '<meta itemprop="description" name="description" content="' . esc_attr($description) . '">' . PHP_EOL;
$custom_keywords = get_post_meta($post, 'meta_keywords', true);
if ($custom_keywords) {
$meta_tags .= '<meta itemprop="keywords" name="keywords" content="' . esc_attr($custom_keywords) . '">';
}
$og_tags .= '<meta property="og:title" content="' . esc_html($title) . '" />' . PHP_EOL;
$og_tags .= '<meta property="og:description" content="' . esc_attr($description) . '" />' . PHP_EOL;