get_posts works but new wp_query doesn’t
You forget $query->the_post(), which makes the same as setup_postdata(). Also you are using $post->ID inside the loop but $post is not current post object in the loop. You have also syntax errors; for example you pass thumnail to wp_get_attachment_image() instead of a string “thumbnail”, and pass name as orderby argument instead of the string “name”, … Read more