GeoDirectory SupportWPML: how to show places in default language when translation is missing – GeoDirectory Support https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/feed Sun, 05 Apr 2026 23:46:51 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16022 <![CDATA[WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16022 Sun, 21 Sep 2014 12:54:37 +0000 wu The title gives it pretty much away. How can that be achieved for listings and detail pages?
So if there is for example mostly content in the default language, the home page and other listings should display the posts in the default language for those posts that are not translated.

I don’t know if it is related, but after I installed WPML, the virtual pages did not show up anymore in the pages section. I opened the pages directly via entering their id that I found out in the database, set the language to my default language and resaved them. Then I added translations to them. After that, they show up again in the pages section.

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16027 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16027 Sun, 21 Sep 2014 13:37:48 +0000 Stiofan O'Connor Hi wu,

I am sure there is a setting in wpml somewhere for that, have you found this and it’s not working or have you just not found this setting?

Stiofan

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16031 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16031 Sun, 21 Sep 2014 13:58:37 +0000 wu All that I found is the switch that decides if places get translated or not.
In both options, the listings only display places with the current languages.

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16033 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16033 Sun, 21 Sep 2014 14:11:07 +0000 Stiofan O'Connor as far as i know the setting is here:
WPML>Languages>Language switcher options>How to handle languages without translation>>

Stiofan

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16034 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16034 Sun, 21 Sep 2014 14:24:34 +0000 wu I tried both settings, but got the same result: it only shows places in the current language and nothing if there is no translation for the current language.

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16039 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16039 Sun, 21 Sep 2014 14:55:37 +0000 Stiofan O'Connor Hi wu, i tried and got the same result, i don’t use WPML much and i’m not sure if this is the designed functionality, can you maybe ask on the wpml forum?

Stiofan

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16143 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16143 Mon, 22 Sep 2014 15:59:40 +0000 wu What I found out so far, is that there is a setting called “Blog posts to display” that does exactly what I need, but only for blog posts and not for other post types. As I understand, it would require custom coding for other post types.

Here I found an example for that:

http://wpml.org/forums/topic/custom-post-type-content-from-default-language-to-display-in-2nd-language/



/* WPML
 * Display default content on missing languages
 */
add_filter('icl_ls_languages', 'wpml_ls_filter');
 
function wpml_ls_filter($languages) {
    global $sitepress;
 
    $default_url = $languages[$sitepress->get_default_language()]['url'];
    foreach($languages as $lang_code => $language){
        if($languages[$lang_code]['missing']==1){
            $languages[$lang_code]['url'] = $default_url;
        }
    }
return $languages;
} 

But in that form it does not work.
Maybe I need to attach it to another hook?

Or would some customization of the query like in that thread be needed?

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16148 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16148 Mon, 22 Sep 2014 16:22:33 +0000 Paolo Hi,

this looks like a good question for WPML forum?

Thanks.

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16376 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16376 Wed, 24 Sep 2014 11:26:45 +0000 wu The guys over there are asking for the code that displays the posts.
I think it is code in geodirectory-functions/listing_filters.php, but I am not sure about that. Could you please point me to the correct location?

]]>
https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16384 <![CDATA[Reply To: WPML: how to show places in default language when translation is missing]]> https://wpgeodirectory.com/support/topic/wpml-how-to-show-places-in-default-language-when-translation-is-missing/#post-16384 Wed, 24 Sep 2014 13:22:55 +0000 wu When I replace:



$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";

with:



$where .= " AND icl_t.language_code = '$default_lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";

in geodir_default_where(), posts are showing up only in the default language only, so this seems to be the right place.

Is this function controlling all GeoDirectory posts on all pages, or is there more code to look out for?

]]>