How do i know the language of post/page in WP using wpml?

Rate this post

I am using wpml by using this code i can get the id of post/page

$id = icl_object_id($course_id, 'page', false, ICL_LANGUAGE_CODE);

i want to know that how can i get the language type of post/page i have tried WP_query but it was futile



I have found the solution ,

$post_language_information = wpml_get_language_information(get_the_ID());
echo <pre>;
print_r($post_language_information );
echo </pre>;


    [language_code] => zh-hant
    [locale] => zh_TW
    [text_direction] => 
    [display_name] => 繁體中文
    [native_name] => 繁體中文
    [different_language] => 

Leave a Reply

Your email address will not be published.

Back to top button