Skip to content

Instantly share code, notes, and snippets.

@RiodeJaneiroo
Created November 5, 2019 09:25
Show Gist options
  • Save RiodeJaneiroo/e9b404c394826717c08bc5564928c5a3 to your computer and use it in GitHub Desktop.
Save RiodeJaneiroo/e9b404c394826717c08bc5564928c5a3 to your computer and use it in GitHub Desktop.
[Add to title and Description Number Page] добавить к title и description номер страницы #wordpress #yoast #seo
add_filter( 'wpseo_title', 'add_paged_title_category_wc' );
function add_paged_title_category_wc($title) {
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
if ( is_tax('product_cat') && $paged > 1) {
$newTitle = 'Страница '.$paged.', '. $title;
return $newTitle;
}
}
add_filter( 'wpseo_metadesc', 'add_paged_descr_category_wc' );
function add_paged_descr_category_wc($descr) {
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
if ( is_tax('product_cat') && $paged > 1) {
$newDescr= 'Страница '.$paged.', '. $descr;
return $newDescr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment