I want to make a menu from a hierarchical custom post type.

There is a default WordPress widget called 'Pages' that give you list of all the pages preserving their hierarchy.

Is there a way to use this widget for custom post types?

  • 1
    Did you check this function wp_list_pages() ? – Sumit Jan 23 '16 at 9:57
  • 1
    It will do the job! For some reason I didn't stumble upon it when googling. Thanks a lot! – Boykodev Jan 23 '16 at 10:05

As per first comment, you can use wp_list_pages like this:

wp_list_pages ( array ( 'post_type' => 'yourcustomposttype' ) );

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.