Support » Plugin: WP-dTree » [Plugin: WP-dTree] Custom Post Type Taxonomy

  • Just installed WP-dTree and it works fine with my site’s default categories. My goal is to use it to display a custom taxonomy categories, populated with posts of a custom post type. This does not work.

    There does not seem to be any way to select post type/taxonomy in the widget settings.

    Also tried adding the template tag like so…
    This will display the custom taxonomy category names, but does not build the links properly, does not display the post count, and does not display post names/links.

    Am I missing something? Does this plugin not support custom post-types/taxonomy?

    Thanks for any advice.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Correction: Post count is working, but I cannot display post names (even with listposts=1 in my args) and the category names are not linking properly

    Plugin Author ulfben


    WP-dTree does not support custom post-types/taxonomy. I don’t even know what they are.

    You can try and convince that it’s a worthile feature though. I recommend you start by linking me to some proper documentation explaining what they are, how they are used and what for.

    And also books. Books are very persuasive. 🙂

    Codex page on custom taxonomy (aka custom categories)

    Codex page on post types (pretty much the main attraction for WP 3.0 imo)

    wp_list_categories has a taxonomy arg (ie taxonomy=my_taxonomy) which will return only categories from that specified category group. Works like a charm. Using the wpdt_list_categories with the same arg returns the correctly filtered category names, but the links are all written as instead of

    Plugin Author ulfben


    Interesting stuff for sure. I’ll probably take a crack at it soonish.

    As for the link-errors, try opening wp-dtree-cat.php and change the MySQL-query at line 47:
    AND {$wpdb->term_taxonomy}.taxonomy = 'category'

    AND {$wpdb->term_taxonomy}.taxonomy = $taxanomy

    And of course, make sure you’ve set the correct rewrite-argument when calling register_taxonomy.

    Plugin Author ulfben


    Oh, and probably change all get_category_link($cat->term_id) to get_term_link($cat->term_id, $taxanomy) too.

    Cool. Thanks ulfben. With your suggestion I should be able to work out the solution. I will post it here if I do.


    I tried the suggestions above, but no luck. The category URLs are still not correct. Maybe the problem is in how I am registering my taxonomy? Here’s the code I’m using:

    function create_transitshare_taxonomies() {
    	register_taxonomy( 'transitshare-category', 'transitshare', array( 'hierarchical' => true, 'label' => 'transitSHARE Categories', 'rewrite' => array("slug" => "transitshare-category") ) );

    That said – I think the bigger issue is getting posts from a custom post type. I tried changing the post_type from ‘post’ to ‘name of my custom post type’ in line 103 of wp-dtree-cat.php but no luck there either.

    Plugin Author ulfben


    Yeah, I suspect this will require a fair bit of re-wiring. WordPress internal functionality is always very close but not quite what I need (for categories especially) so there’s a bunch of custom queries in there that’ll need major revisions.

    No kidding! I can either get categories with posts (but no category hierarchy) or hierarchical categories (but no categories).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: WP-dTree] Custom Post Type Taxonomy’ is closed to new replies.