register_taxonomy("genre", array(CUSTOM_POST_TYPE_WORK),
array(
"hierarchical" => false,
"label" => __be('Categorias de Entidade'),
"labels" => $genre_labels,
"rewrite" => true,
'show_admin_column' => true
)
);
to this:
register_taxonomy("genre", array(CUSTOM_POST_TYPE_WORK),
array(
"hierarchical" => true, //this is the changed line from false to true
"label" => __be('Categorias de Entidade'),
"labels" => $genre_labels,
"rewrite" => true,
'show_admin_column' => true
)
);
As you know, this little change made my taxonomy "My works" work as wordpress category instead wordpress tags. On this way, now I can have subcategories inside main category (hierarchial) and call a specific category with all content of subcategories inside of it. I needed to change that cause my client have to insert data via wp-admin as categories and with specific post types that I have been created.It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Even with all that story I am still not convinced that you should use hierarchical here, but even more I am concerned how many issues you could face cause of that. Lets hope not many :-)
But to the topic. In
works-list.php
you have twoif
s with use$genre_template
- they are there to hide filter when showing only one genre and to display only posts of current genre.You should check both "ifs" but to show filter remove second one. Change: to: Hope that helps.
With regards.
It works good.
But the filter shows all categories in both pages. Im trying to show only sub-categories of category that is being played on page. I think the query must be the same and after, I have to filter the results by using current category. How can I do this?
Unfortunately I don't have time to dig into hierarchical taxonomies, so you will have to do it alone.
Anyway most if not all code you will be editing is in
works-list.php
. More info about taxonomies you can find in wordpress Codexhttp://codex.wordpress.org/Taxonomies
http://codex.wordpress.org/Function_Reference/register_taxonomy
If I will find anything about your case I will let you know here.
With regards.
I am investigating by my self...and Im a little more close from solution