Created
November 5, 2019 09:25
-
-
Save RiodeJaneiroo/e9b404c394826717c08bc5564928c5a3 to your computer and use it in GitHub Desktop.
[Add to title and Description Number Page] добавить к title и description номер страницы #wordpress #yoast #seo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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