fix
This commit is contained in:
@@ -79,17 +79,7 @@ add_action( 'wp_head', 'sev_tort_meta_tags', 1 );
|
||||
function sev_tort_meta_tags() {
|
||||
$page = sev_tort_current_page_config();
|
||||
|
||||
if ( is_front_page() ) {
|
||||
echo '<meta name="robots" content="index, follow">' . "\n";
|
||||
printf( '<meta name="description" content="%s">' . "\n", esc_attr( sev_tort_home_seo_description() ) );
|
||||
printf( '<link rel="canonical" href="%s">' . "\n", esc_url( home_url( '/' ) ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $page ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $page ) {
|
||||
$robots = ! empty( $page['indexable'] ) ? 'index, follow' : 'noindex, nofollow';
|
||||
printf( '<meta name="robots" content="%s">' . "\n", esc_attr( $robots ) );
|
||||
|
||||
@@ -105,17 +95,26 @@ function sev_tort_meta_tags() {
|
||||
}
|
||||
|
||||
printf( '<link rel="canonical" href="%s">' . "\n", esc_url( home_url( '/' . $page['slug'] . '/' ) ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( is_front_page() ) {
|
||||
echo '<meta name="robots" content="index, follow">' . "\n";
|
||||
printf( '<meta name="description" content="%s">' . "\n", esc_attr( sev_tort_home_seo_description() ) );
|
||||
printf( '<link rel="canonical" href="%s">' . "\n", esc_url( home_url( '/' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'wp_robots', 'sev_tort_wp_robots', 100 );
|
||||
function sev_tort_wp_robots( $robots ) {
|
||||
$page = sev_tort_current_page_config();
|
||||
|
||||
if ( is_front_page() || ( $page && ! empty( $page['indexable'] ) ) ) {
|
||||
if ( $page && ! empty( $page['indexable'] ) ) {
|
||||
unset( $robots['noindex'], $robots['nofollow'] );
|
||||
$robots['index'] = true;
|
||||
$robots['follow'] = true;
|
||||
$robots['max-image-preview'] = 'large';
|
||||
return $robots;
|
||||
}
|
||||
|
||||
if ( $page && 'politika-konfidencialnosti' === $page['slug'] ) {
|
||||
@@ -124,6 +123,13 @@ function sev_tort_wp_robots( $robots ) {
|
||||
$robots['nofollow'] = true;
|
||||
}
|
||||
|
||||
if ( ! $page && is_front_page() ) {
|
||||
unset( $robots['noindex'], $robots['nofollow'] );
|
||||
$robots['index'] = true;
|
||||
$robots['follow'] = true;
|
||||
$robots['max-image-preview'] = 'large';
|
||||
}
|
||||
|
||||
return $robots;
|
||||
}
|
||||
|
||||
@@ -164,7 +170,7 @@ function sev_tort_schema_markup() {
|
||||
'inLanguage' => 'ru-RU',
|
||||
);
|
||||
|
||||
if ( is_front_page() ) {
|
||||
if ( ! $page && is_front_page() ) {
|
||||
$schema[] = sev_tort_faq_schema(
|
||||
array(
|
||||
array(
|
||||
@@ -274,19 +280,19 @@ add_filter( 'pre_get_document_title', 'sev_tort_document_title' );
|
||||
function sev_tort_document_title( $title ) {
|
||||
$page = sev_tort_current_page_config();
|
||||
|
||||
if ( is_front_page() ) {
|
||||
return sev_tort_home_seo_title();
|
||||
}
|
||||
|
||||
if ( ! $page ) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
if ( $page ) {
|
||||
if ( 'politika-konfidencialnosti' === $page['slug'] ) {
|
||||
return 'Политика в отношении обработки персональных данных';
|
||||
}
|
||||
|
||||
return ! empty( $page['seo_title'] ) ? $page['seo_title'] : $page['title'];
|
||||
}
|
||||
|
||||
if ( is_front_page() ) {
|
||||
return sev_tort_home_seo_title();
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
function sev_tort_home_seo_title() {
|
||||
|
||||
Reference in New Issue
Block a user