I have a taxonomy-taxonomy.php page that needs to look like so:
CUSTOM POST TYPE TITLE (RESOURCES)
Custom Taxonomy 1 (Resource Types)
Resource Type Term 1 (White Papers)
White Paper post 1
White Paper post 2
White Paper post 3
Resource Type Term 2 (Videos)
Videos post 1
Videos post 2
Videos post 3
Tried to make sense of all the new documentation for Wordpress 3.0, but it only made me more confused as it seems to be mixed up with 2.8.
Hey manon1165 , I actually just accomplished this. Was a huge pain, hopefully my code snippet will help!
I made a custom page template. And did something along the lines of
Now, just
print_r($cats)
and you will see the array of the categories.You will need to convert the object to an array, I did so with.
I did
Hope that helps!
It's not necessary to transform the object to an array, you can perfectly work with the object without too much hassle. What is curious (at least for me), is that you get something like this:
It's basically, an array of objects, so you've to treat them that way. For example if I want the name of the the first one:
If you need to iterate through the elements, you still can use
foreach();
.That way you can post the articles from your taxonomy.
For the custom post types, you'll have to create a loop like this:
Then you can create multiple loops each of one for each taxonomy/term :).
If you want to get even more fancy (don't want to repeat yourself a hundred times) you can include the second loop inside the first one and assign variables to the taxonomy (resources ie) and the terms it has (videos) (from your example only the last one). The idea is that you would have a normal (typical) wordpress loop restricted to the custom post-type and each one of the terms.
Obviously you can do the inverse thing too, create the normal loop for a single-template custom type (it's looks like you have only one), and inside includes all the custom terms.
Not very elegant, but that's the best way I can came up with it :P. Hope that someone can understand this, sounds confusing.
Maybe could it be possible with some callback function?.