add canonical authors
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
$query = new WP_Query($args);
|
||||
?>
|
||||
<?php get_template_part('partials/post-list', null, ['large_first_image' => false, 'query' => $query]); ?>
|
||||
<div class="frontpage-next"><a href="https://agroexpert.press/category/all-events/page/2/">Еще новости</a></div>
|
||||
<div class="frontpage-next"><a href="https://agroexpert.press/all-events/page/2/">Еще новости</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php get_footer(); ?>
|
||||
|
||||
@@ -639,9 +639,9 @@ function custom_meta_tags() {
|
||||
$term = get_queried_object();
|
||||
$canonical_url = get_term_link($term);
|
||||
|
||||
if ($paged > 1) {
|
||||
//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;
|
||||
@@ -657,6 +657,25 @@ function custom_meta_tags() {
|
||||
$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;
|
||||
$author_description = get_the_author_meta('description', $author->ID);
|
||||
$canonical_url = get_author_posts_url($author->ID);
|
||||
|
||||
$title = 'Материалы автора ' . $author_name . ' - ' . $sitename;
|
||||
$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 name="author" content="' . esc_attr($author_name) . '">' . PHP_EOL;
|
||||
|
||||
$meta_tags .= '<link rel="canonical" href="' . esc_url($canonical_url) . '" />' . PHP_EOL;
|
||||
|
||||
$og_tags .= '<meta property="og:url" content="' . esc_url($canonical_url) . '" />' . 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();
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<?php get_template_part('partials/pinned-post'); ?>
|
||||
<div class="most-read hero__most-read">
|
||||
<div class="most-read__inner">
|
||||
<p class="most-read__title subtitle-20">Самое читаемое</p>
|
||||
<p class="most-read__title subtitle-20">Главное сегодня</p>
|
||||
<div class="most-read__links">
|
||||
<?php get_template_part('partials/most-read-posts'); ?>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<?php if (is_front_page()) : ?>
|
||||
<div class="most-read mobile">
|
||||
<div class="most-read__inner">
|
||||
<p class="most-read__title subtitle-20">Самое читаемое</p>
|
||||
<p class="most-read__title subtitle-20">Главное сегодня</p>
|
||||
<div class="most-read__links">
|
||||
<?php get_template_part('partials/most-read-posts'); ?>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php if (!is_front_page()) : ?>
|
||||
<div class="most-read content-right__most-read">
|
||||
<div class="most-read__inner">
|
||||
<p class="most-read__title subtitle-20">Самое читаемое</p>
|
||||
<p class="most-read__title subtitle-20">Главное сегодня</p>
|
||||
<div class="most-read__links">
|
||||
<?php get_template_part('partials/most-read-posts'); ?>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ $categoryLink = get_queried_object()->slug;
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
<a href="/events" class="articles-preview__show-next">Все мероприятия</a>
|
||||
<a href="/events/" class="articles-preview__show-next">Все мероприятия</a>
|
||||
<div class="articles__spacer-container">
|
||||
<div class="articles__spacer"></div>
|
||||
<div class="articles__spacer"></div>
|
||||
|
||||
Reference in New Issue
Block a user