Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by sarah.n 7 years, 4 months ago.

Assigned support staff: sarah.n.

Author Posts
March 26, 2013 at 10:27 pm #115181


As per the title. I can see the text on my homepage which is a regular WordPress post but there is no text showing on any of my translated product pages. How can I get this to show? Site is

March 27, 2013 at 8:02 am #115210


Languages: English (English ) German (Deutsch )

Hello Ian,

You can add the following function in your theme's functions.php file:

// USAGE place this on the single.php, page.php
// function wpml_content_languages($args)
// args: skip_missing, before, after
// defaults: skip_missing = 1, before =  __('This post is also available in: '), after = ''
function wpml_content_languages($args=''){
        $languages = icl_get_languages($args);
        if(1 < count($languages)){
            echo isset($before) ? $before : __('This post is also available in: ', 'sitepress');
            foreach($languages as $l){
                if(!$l['active']) $langs[] = '<a href="'.$l['url'].'">'.$l['translated_name'].'</a>';
            echo join(', ', $langs);
            echo isset($after) ? $after : '';

Then call wpml_content_languages(); where you want "This post is also available in:" to display in your single product template file.

Let me know how you get on.

March 27, 2013 at 12:20 pm #115297


Thank you very much. I have added the code to my child theme functions.php. I guess I can add a piece of code in the single product page template but can you help with the exact syntax of the
call wpml_content_languages();


March 28, 2013 at 7:25 am #115457


Languages: English (English ) German (Deutsch )

Hey Ian,

Sorry I should have wrote about this better in my previous reply.

You'll need to add the following in your single product page template. If the section you want to add it to is already inside <?php ?> then you can skip the php tags.

<?php wpml_content_languages(); ?>

The topic ‘[Closed] How to get "This post is also available in…" on product pages with WooCommerce’ is closed to new replies.