Support » Plugin: WP-dTree » Can I insert a category tree in the body of a page? Not as a widget?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ulfben

    (@ulfben)

    Read the documentation and then go forth and use the template-tags since this is exactly what they are for?

    rairose

    (@rairose)

    I looked at that plugin, but from what I understand it only works as a widget. I don’t want a widget. I need something that will go into the body of a page.

    rairose

    (@rairose)

    Ok, I think I figured out how to add the tag to the template.

    If I insert this code:

    <div class="dtree">
            <?php
                if(function_exists('wpdt_list_categories();'))
            ?>
        </div>

    into the page.php template, will it show up in all of my pages? I only want the category tree to appear on this page: http://www.ptsdchampion.com/category-list/

    I’m sorry, I’m not well versed in php and I’m struggling to understand how this works.

    Plugin Author ulfben

    (@ulfben)

    Sort of. You need to actually call the function first. And then you need to work out a way to only call the function on that specific page. Not difficult at all, but you need to do that research on your own.

    Here’s how to call the function you need:

    <div class="dtree">
    	<?php
    		if(function_exists('wpdt_list_categories')){
    			$settings = wpdt_get_categories_defaults();
    			wpdt_list_categories($settings);
    		}
    	?>
    </div>

    $settings in this example will simply be an array with all the different options pre-set to the default values. Dump it somewhere to read through what all the settings are and play around with it.

    rairose

    (@rairose)

    Oh! Ok! Cool 🙂 Do I put this in the page.php file?

    rairose

    (@rairose)

    Nothing that I’ve tried has worked. I’ve read through the documentation for the plugin and for WordPress’s get_categories function, and I can’t seem to make it work.

    I just made a page with a regular old ul/li list. I’ll have to update it every time I add a new post, but it’s the only way I’ve been able to get it to work. 🙁

    Categories

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.