I came up against this same situation today I think.
First thing to do is to add the the following parameter to the $args array that you are passing to get_posts()…
‘orderby’ => ‘menu_order’
This will sort the returned array of attachments in relation to the gallery order you’re requesting (if I’ve understood correctly).
However, when you do the above you’ll notice that the results are actually output in descending gallery order which is the inverse of how they are presented in the gallery admin panel. To rectify this and make everything nice and user friendly you just need to reverse the get_posts() array that’s returned, before you pass it through the foreach construct.
So to take your example…
Viewing 1 replies (of 1 total)
The topic ‘"gallery" display order with wp_get_attachment_image’ is closed to new replies.