Since this is a premium plugin, it's not likely that you're going to get a great answer here. You might search the WPML documentation here wpml.org/documentation or buy a support license for $30 here: wpml.org/purchase They actually have a pretty reasonable setup there, and would be able to give you much better answers much more quickly. Also: free upgrades!
–
John P BlochMar 22 '11 at 13:20

I would recommend putting questions and answers here, this is an independent community and you do not have to pay to be able to access the forum. Yes, I am paying customer of WPML, but I have their forum implementation and access policy.
–
sorinMay 21 '11 at 21:32

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:

$original_ID = icl_object_id( $post->ID, 'post', false, 'en' );

to:

$original_ID = icl_object_id( $post->ID, 'any', false, 'en' );

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().