I have written and translated a theme and all is working fine, except the starter content. It seems that i am not able to translate the content and it is still displayed in English, even though I have included translation in another language and the default WordPress language is set to the other language. Here is my starter content array:
'posts' => array(
//Add pages
'home' => array(
'post_type' => 'page',
'post_title' => _x( 'Homepage', 'slug' ),
'post_content' => _x( 'Welcome to your site! This is your homepage, which is what most visitors will see when they come to your site for the first time. Use the customizer to choose between a static homepage or display the latest posts in a beautiful 2-column layout instead.', 'slug' ),
),
'about' => array(
'post_type' => 'page',
'post_title' => _x( 'About', 'slug' ),
'thumbnail' => '{{featured-image-about}}',
'post_content' => _x( 'Welcome on board! This is your about page, which is what most visitors will check to find out more information about yourself. Write here about your hobbies, work and passion.', 'slug' ),
),
'contacts' => array(
'post_type' => 'page',
'post_title' => _x( 'Contacts', 'slug' ),
'post_content' => _x( 'This is a good place to add some basic contact information, such as an address and a phone number. You can also add a contact form with contact form 7 or another plugin', 'slug' ),
),
),
P.S.: It seems like the pages (home, about, contacts) are stored in alphabetical order (about, contacts, home) and displayed alphabetically as menu items. I would also be interested to know if there is a way to sort the pages by the way they entered, e.g. home, about, contacts rather than about, contacts, home.
_x
requires context to specified – Latheesh V M Villa Aug 30 '19 at 20:43