문제

I developed a wordpress theme which has a few cusotm post types in it. and i created the .po language file and it successfully imported the strings from php files.

The problem is that the translations related to custom post types aren't showing in admin area. I've tried bot __() and _x() functions, but no luck.

I appreciate if someone tell me what's the problem here.

도움이 되었습니까?

해결책

Did you load the theme text domain? Example:

function so16309230_after_setup_theme(){
    load_theme_textdomain( 'my_theme', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'so16309230_after_setup_theme' );

The text domain also needs to be declared in your style.css stylesheet header:

Text Domain: my_theme

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top