Home › Forums › Add-ons › Gallery Field › WPML and Gallery addon problem › Reply To: WPML and Gallery addon problem
This is my solution untill you solved out this:
in your functions.php put this function:
function custom_get_attachments($ids){
GLOBAL $wpdb;
$query = "SELECT * FROM {$wpdb->posts} WHERE post_type = 'attachment' AND ID IN ('".implode("','", $ids)."')";
$results = $wpdb->get_results($query);
return $results;
}
and then in gallery.php instead of
$attachments = get_posts(array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post__in' => $value,
));
put this
$attachments = custom_get_attachments($value);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.