WPML
상태
개발자가 해결함
보고된 제품
WPML SEO 2.1.0
해결된 버전
SEOPress 8.4
관련 플러그인/테마
SEOPress
주제 태그
Compatibility

문제 개요

WPML과 함께 SEOPress 플러그인을 사용할 때, SEOPress가 생성한 XML 사이트맵에서 제품 아카이브 슬러그가 올바르게 번역되지 않습니다.

임시 해결 방법

진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.


  • …/wp-content/plugins/wp-seopress/templates/sitemap/single.php 파일을 여세요.

  • 41번째 줄을 찾으세요.

  • 다음을:
    // WPML Workaround
    if (class_exists('SitePress')) {
    	if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) {
    		$original_language = apply_filters( 'wpml_current_language', NULL );
    		$language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
    
    		if (!empty($language_list)) {
    			foreach ($language_list as $key => $language_infos ) {
    				if ($original_language != $language_infos['language_code']) {
    
    					// Switch Language
    					do_action( 'wpml_switch_language', $language_infos['language_code']);
    
    					$archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path))));
    
    					// Restore language to the original
    					do_action( 'wpml_switch_language', $original_language);
    				}
    			}
    		}
    	}

  • 다음으로 변경하세요:
    // WPML Workaround for compsupp-7538 and compsupp-6419
    if ( class_exists('SitePress' )) {
    	if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) {
    		$original_language = apply_filters( 'wpml_current_language', NULL );
    		$language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
    
    		if (!empty($language_list)) {
    			foreach ($language_list as $key => $language_infos ) {
    				if ($original_language != $language_infos['language_code']) {
    					// Switch Language
    					do_action( 'wpml_switch_language', $language_infos['language_code']);
    
    					if ( $path == 'product' && function_exists('wc_get_page_id') ) {
    						$shop_page_id = wc_get_page_id('shop');
    						$archive_links[] = 	htmlspecialchars(urldecode(user_trailingslashit(get_permalink($shop_page_id))));
    					} else {
    						$archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path))));	
    					}
    
    					// Restore language to the original
    					do_action( 'wpml_switch_language', $original_language);
    				}
    			}
    		}
    	}
    }

알려진 모든 문제 →