Posts Tagged ‘multilanguage’

In multilanguage website,generally when user click in language flag, all website content transaltes into perticular language.
for that purpose,we need to give many page title section and page content section as per number of language.It is done by plugin called Qtranslate,further more If we want to change meta field for each language we need use Plugin called (1) ACF and (2) ACF qtranslate

plugin that need to install:qtranslate,ACF(Advance Custom Field)

After installed plugins,
qtranslate:Add languages as per your requirement.For example 1.English(Language code:en) 2.Thailand(th). After add language we need to add post that has title and content in both language.
ACF : We need to add meta field for post or page.So, Let’s take Example:meta_key is ‘my_meta_key’.

 

Now after added single post in both language.we need to filter that post in front-end: means changes in code 🙂
The post content will automatically change as per language change.
Now for post meta, here is code
in single.php

$arr=get_field( ‘pg_header’, $post->ID,  true );
print_r($arr);

For more :

  echo _e($term->description, ‘qtranslate’);

$content = apply_filters(‘the_content’, $about_us->post_content);