Support » Plugin: WP-dTree » Can I insert a category tree in the body of a page? Not as a widget?
1 year ago
I want to add a list of ALL of my categories (even ones with zero posts in them) to this page: http://www.ptsdchampion.com/archive/
But I don’t want it to appear as a widget. I want it in the body of the page. How can I do this?
Read the documentation and then go forth and use the template-tags since this is exactly what they are for?
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.
Ok, I think I figured out how to add the tag to the template.
If I insert this code:
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.
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:
$settings = wpdt_get_categories_defaults();
$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.
Oh! Ok! Cool 🙂 Do I put this in the page.php file?
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. 🙁