• Resolved ventres

    (@ventres)


    add_filter('wpseo_title', 'filter_product_wpseo_title');
    
    function filter_product_wpseo_title($title) {
        if(  is_singular( 'product') ) {
    		
    	$post_id = get_the_ID();
    	
    	$terms = wp_get_post_terms( $post_id, 'product_cat' );
    	foreach ( $terms as $term ) $categories[] = $term->slug;
    	
    	if(in_array( 'en_table', $categories )){
    		$title = get_the_title() . ' - Table '; // en text
    	}
    	if(in_array( 'ru_table', $categories )){
    		$title = get_the_title() . ' - Стол'; // ru text not working
    	}
        }
        return $title;
    }

    Also does not work through the template in yoast SEO. How to allow the Russian language in the title in the description?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support amboutwe

    (@amboutwe)

    I tested a simple return statement and it worked with Russian. So this likely means something else interferes with the title change. Does the snippet below change post titles?

    add_filter('wpseo_title', 'filter_wpseo_title');
    
    function filter_wpseo_title($title) {
        return $title. ' - Стол';
    }

    Closed. No further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Russian characters are not supported in title’ is closed to new replies.