WordPress gallery not sorting the images if I change the order of image ids May 30, 2022 by Tarik Billa Add order and/or orderby parameters to your shortcode. For example: https://codex.wordpress.org/Gallery_Shortcode#Options