 Roni
|
Hi using this function, tried many variations, but simply can't get the original language post attachments for translated languages.
function apartment_photos () {
echo '<div id="page_featured">';
echo the_post_thumbnail( 'fsingle' );
echo '</div><div class="clear"></div>';
echo '<div id="single_gallery" class="marquee">';
$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' => $oID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order_by' => '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->ID);
$atsrc = wp_get_attachment_image_src($ats->ID, array(125,80));
echo '<a href="'. $ats->guid .'" class="lytebox" data-lyte-options="group:gal" data-title="'.get_the_title($ats->ID).'"
title="'.get_the_title($ats->ID).'">';
echo '<img src="'.$atsrc[0].'" width="125" height="80" title="'.get_the_title($ats->ID).'" alt="'.get_the_title($ats->ID).'">';
echo '</a>';
}
echo '</div>';
echo '<div class="clear"></div>';
}
If I set post id manually, everything works fine…
|
 Harshad
|
Did you give a try setting language information button?
Please go to wpml -> support -> click on the troubleshooting link at the bottom of the page.
On the troubleshooting page click on the set language information button.
|
 Roni
|
No luck… Tried that already…
|
 Roni
|
I would really need help with this one… Still no luck. Just can't get translated posts to show original post gallery images…
|
 Harshad
|
Dear Roni,
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?
I will further investigate on your issue(s).
|
 Roni
|
Thank you Harshad for great support
|