Title: Using WP-dTree with custom post types
Last modified: August 30, 2016

---

# Using WP-dTree with custom post types

 *  [luKkw](https://wordpress.org/support/users/lukkw/)
 * (@lukkw)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/)
 * Hello,
    I was wondering if there was a way to use the WP-dTree Pages with custom
   post types instead of pages.
 * The main purpose is to get a treeview of hierarchical custom post types the way
   the WP-dTree Pages widget do.
    I tried various solutions, eventually use the 
   WP-dTree Menu in conjunction with an auto-submenu plugin, but it’s not really
   convincing.
 * I found on this [link ](https://wordpress.org/support/topic/custom-post-types-27?replies=5)
   the beginnings of a reply, however, it seems the code has changed since, so I
   have trouble to make it work.
 * Any info much appreciated 😀 Thanks!
 * [https://wordpress.org/plugins/wp-dtree-30/](https://wordpress.org/plugins/wp-dtree-30/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [luKkw](https://wordpress.org/support/users/lukkw/)
 * (@lukkw)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252611)
 * So I found one imperfect solution, but it worked and suited enough my needs :
   
   within wp-dtree-pge.php, below – $pageresults = get_pages(array( I just added–‘
   post_type’ = > ‘MYCUSTOMPOSTTYPE’, without changing anything else.
 * The WP-dTree Pages widget now would just search for MYCUSTOMPOSTTYPE custom post
   types to fill the list.
    I could not make all options work, but these ones perfectly
   do: – folders are links – highlight selection – open to selection – sort by “
   Menu Order”
 * It’s imperfect so if there still is a better way to proceed, I’ll take it ! 😀
 *  [Artus](https://wordpress.org/support/users/tintalent/)
 * (@tintalent)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252849)
 * Thank you for this solution, do you think it could be possible to have 2 trees
   for 2 custom post types.
 * Thanks again,
 *  Thread Starter [luKkw](https://wordpress.org/support/users/lukkw/)
 * (@lukkw)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252880)
 * I’m pretty sure it is possible but you’ll have to change either the plugin code(
   which is highly above my skills) or use (and sacrifice) another wp-dtree-XXX.
   php (like the category one).
    In this last solution, I suggest trying to copypaste
   the whole code of wp-dtree-pge.php to the one you’re willing to sacrifice. Unfortunately
   I do not remember if it is necessary to change something somewhere else.
 *  Plugin Author [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252893)
 * … wouldn’t it be easier to just use the WP-dTree Archive widget and use the `
   Specify Post type`-setting?
 *  [Artus](https://wordpress.org/support/users/tintalent/)
 * (@tintalent)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252894)
 * Thanks for the reply.
    I used the archive widget to set the post type and works
   ok but with the archive functionality but not like pages (with subpages and custom
   order). I modified the pages file to use with custom post type and it works nicely.
   But soon I will be needing multiple trees for multiple post types. I cloned the
   whole plugin and changed all the function names but doest work. Upon activation
   only one version works.
 * This a really great plugin by tha way.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using WP-dTree with custom post types’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-dtree-30_fcfcf8.svg)
 * [WP-dTree](https://wordpress.org/plugins/wp-dtree-30/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-dtree-30/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-dtree-30/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-dtree-30/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-dtree-30/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-dtree-30/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Artus](https://wordpress.org/support/users/tintalent/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/using-wp-dtree-with-custom-post-types/#post-6252894)
 * Status: not resolved