<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>WPML  &#187;  Topic: []&nbsp;Can&#039;t get icl_object_id to return original post ID for custom posts</title>
		<atom:link href="http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/feed/" rel="self" type="application/rss+xml" />
		<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/feed/</link>
		<description></description>
		<pubDate></pubDate>
		<generator>http://bbpress.org/?v=2.1.2</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54202</guid>
					<title><![CDATA[Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54202</link>
					<pubDate>Sun, 01 Apr 2012 16:26:14 +0000</pubDate>
					<dc:creator>Roni</dc:creator>

					<description>
						<![CDATA[
						<p>Hi using this function, tried many variations, but simply can&#039;t get the original language post attachments for translated languages.</p>
<div class="sh-wrapper">
<pre class="brush: php; title: ; notranslate">
function apartment_photos () {
    echo '&lt;div id=&quot;page_featured&quot;&gt;';
    echo the_post_thumbnail( 'fsingle' );
    echo '&lt;/div&gt;&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;';
    echo '&lt;div id=&quot;single_gallery&quot; class=&quot;marquee&quot;&gt;';
	$type = get_post_type($id);
	$oID = icl_object_id($id, $type, false, 'en'); // tried here to set post type to my custom post type 'listing' or 'post', neither works
	$attachments = get_children(array('post_parent' =&gt; $oID, 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'order_by' =&gt; 'menu_order')); 
// when using actual original language post id as 33 instead of $oID, all works fine...
	            if ( ! is_array($attachments) ) continue;
	            $count = count($attachments);
 
	            foreach ($attachments as $ats) {
	            $atmeta = wp_get_attachment_metadata($ats-&gt;ID);
	            $atsrc = wp_get_attachment_image_src($ats-&gt;ID, array(125,80));
    echo '&lt;a href=&quot;'. $ats-&gt;guid .'&quot; class=&quot;lytebox&quot; data-lyte-options=&quot;group:gal&quot; data-title=&quot;'.get_the_title($ats-&gt;ID).'&quot; 

title=&quot;'.get_the_title($ats-&gt;ID).'&quot;&gt;';
    echo '&lt;img src=&quot;'.$atsrc[0].'&quot; width=&quot;125&quot; height=&quot;80&quot; title=&quot;'.get_the_title($ats-&gt;ID).'&quot; alt=&quot;'.get_the_title($ats-&gt;ID).'&quot;&gt;';
    echo '&lt;/a&gt;';
}
    echo '&lt;/div&gt;';
    echo '&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;';
}
</pre>
</div>
<p>If I set post id manually, everything works fine&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54225</guid>
					<title><![CDATA[Reply To: [Assigned] Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54225</link>
					<pubDate>Mon, 02 Apr 2012 04:16:53 +0000</pubDate>
					<dc:creator>Harshad</dc:creator>

					<description>
						<![CDATA[
						<p>Did you give a try setting language information button?</p>
<p>Please go to wpml -&gt; support -&gt; click on the troubleshooting link at the bottom of the page.</p>
<p>On the troubleshooting page click on the set language information button. </p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54447</guid>
					<title><![CDATA[Reply To: [Waiting for user feedback] Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54447</link>
					<pubDate>Tue, 03 Apr 2012 13:38:00 +0000</pubDate>
					<dc:creator>Roni</dc:creator>

					<description>
						<![CDATA[
						<p>No luck&#8230; Tried that already&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54655</guid>
					<title><![CDATA[Reply To: [Assigned] Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54655</link>
					<pubDate>Wed, 04 Apr 2012 20:02:42 +0000</pubDate>
					<dc:creator>Roni</dc:creator>

					<description>
						<![CDATA[
						<p>I would really need help with this one&#8230; Still no luck. Just can&#039;t get translated posts to show original post gallery images&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54675</guid>
					<title><![CDATA[Reply To: [Assigned] Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54675</link>
					<pubDate>Thu, 05 Apr 2012 03:50:59 +0000</pubDate>
					<dc:creator>Harshad</dc:creator>

					<description>
						<![CDATA[
						<p>Dear Roni,</p>
<p>Any chance if you could send me your ftp and wp-admin details along with the filename which has the code of original language post attachments to my email address?</p>
<p>I will further investigate on your issue(s).</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54864</guid>
					<title><![CDATA[Reply To: [Waiting for user feedback] Can&#039;t get icl_object_id to return original post ID for custom posts]]></title>
					<link>http://wpml.org/forums/topic/cant-get-icl_object_id-to-return-original-post-id-for-custom-posts/#post-54864</link>
					<pubDate>Fri, 06 Apr 2012 14:56:35 +0000</pubDate>
					<dc:creator>Roni</dc:creator>

					<description>
						<![CDATA[
						<p>Thank you Harshad for great support <img src='http://d2salfytceyqoe.cloudfront.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>


<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (Requested URI is rejected)
Content Delivery Network via Amazon Web Services: CloudFront: d2salfytceyqoe.cloudfront.net

 Served from: wpml.org @ 2013-05-23 01:37:32 by W3 Total Cache -->