i'm running my web in english and german using the WPML plugin. my question: when in english mode - is it possible getting the page_title() but in german?
thanks
|
i'm running my web in english and german using the WPML plugin. my question: when in english mode - is it possible getting the page_title() but in german? thanks |
|||||||||
|
|
Let's say the original language of your site is english, then when visiting a german post you would return the title of the corresponding english post like that :
Hope that helps, in any case check out the documentation for icl_object_id(); |
|||
|
|
|
Thanks for that mike23, was a lifesaver for me today. However that exact code didn't work for me, I did have to do some modifications in order to get it to work in my situation which may be due to a newer version of the WPML plugin. I had to change:
to:
Notice that the only change is 'post' -> 'any'. It's a small change but made a world of difference as any other type that I entered would not work for me. Hope this helps someone that runs into the same issue. PS: I found that the 'any' type could be used by going to the file where that function is created: /wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php. When in the file search for icl_object_id(). |
|||
|
|