WPML
상태
미해결
보고된 제품
WPML SEO 2.1.1
관련 플러그인/테마
Yoast SEO
주제 태그
Compatibility

문제 개요

Yoast SEO를 사용할 때 플러그인은 작성자 아카이브 페이지의 head 섹션에 Open Graph 메타 태그를 자동으로 추가합니다. 하지만 번역된 작성자 아카이브 페이지에서는 og:url 메타 태그가 기본 언어의 URL을 표시합니다.

임시 해결 방법

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


  • 테마의 functions.php 파일을 여세요.
    /**
     * Workaround to fix og:url meta tag on translations of author archives
     */
    add_filter( 'wpseo_opengraph_url', function($url, $presentation){
    
    	if ( $presentation instanceof YoastWPSEOPresentationsIndexable_Author_Archive_Presentation ){
    		$user_id = $presentation->source['post_author'];
    		$url = rawurlencode( get_author_posts_url($user_id) );
    	}
    
    	return $url;
    }, 10, 2 );
            

알려진 모든 문제 →