og:locale changing
-
Hello,
How can I change this:
<meta property="og:locale" content="ru_RU" class="yoast-seo-meta-tag" />
to this:
<meta property="og:locale" content="ru_UA" class="yoast-seo-meta-tag" />
I have tryed
this
function modify_og_locale( $locale ) {
// Проверяем, если это русская версия
if ( $locale === 'ru_RU' ) {
return 'ru-UA'; // Меняем на ru-UA
}
return $locale;
}
add_filter( 'wpseo_locale', 'modify_og_locale' );
and this
function override_og_locale() {
// Удаляем старый мета-тег, добавленный Yoast
remove_action( 'wpseo_head', array( 'WPSEO_Frontend', 'og_locale' ), 5 );
// Добавляем новый тег с измененным значением
echo '<meta property="og:locale" content="ru-UA" class="yoast-seo-meta-tag" />';
}
add_action( 'wpseo_head', 'override_og_locale', 1 );
not helps
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- You must be logged in to reply to this topic.