Does anyone know of a way to create a sitemap by using wp_list_pages and have the order by the same orders a custom nav menu?


Using wp_list_pages you can sort order only by:

  • 'post_title'
  • 'menu_order'
  • 'post_date'
  • 'post_modified'
  • 'ID'
  • 'post_author'
  • 'post_name'

anything else (like order by custom menu order) you would have to write your own function. But a better way to get it done would be to create a custom walker for it so you could control the output.


Here's a snippet I use to create a sitemap based on custom menu order: http://snipplr.com/view/54404/wordpress-custom-sitemap-shortcode-following-custom-menu-order/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.