How to sort queried pages by an array of page ids?
There is no need to use such custom code when wordpress provides a better way of ordering the pages using menu_order. You can see this option under Page Attributes box on the right side of page edit screen. You can assign the ordering as per your criteria, then use the following code <?php global $wp_query; … Read more