-
-
Save Zurabpwnz/7dda42585fb90514067cb9fc06d805a6 to your computer and use it in GitHub Desktop.
Изменяем title на страницах пагинации Yoast Seo
This file contains hidden or 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
| if ( ! function_exists( 't5_add_page_number' )) | |
| { | |
| function t5_add_page_number( $s ) | |
| { | |
| global $page; | |
| $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; | |
| ! empty ( $page ) && 1 < $page && $paged = $page; | |
| // $paged > 1 && $s .= ' | ' . sprintf( __( 'Страница %s' ), $paged ); | |
| // return $s; | |
| if($paged>1 AND is_tax('product_cat')) { | |
| $term = $term = get_term( get_queried_object_id(), 'product_cat' ); | |
| return $term->name.' | ' . sprintf( __( 'Страница %s' ), $paged ); | |
| } else { | |
| return $s; | |
| } | |
| } | |
| add_filter( 'wpseo_title', 't5_add_page_number', 100, 1 ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment