Pergunta

im really struggling to find clear documentation on the following subject.

  • I have created a custom post type called 'file'.
  • List item I've also created a taxonomy called 'file_category'

From the WordPress Admin i've created categories: Configs, Media, Demos, SourceTV

  • I have a page using a template to display a list of all the 'file' posts.
  • I want to then display a list of the categories so users can filter the 'file' results.

Thank you in advance for taking the time to post your replies!!!

Foi útil?

Solução

Technically speaking, those "file_category" categories you created are called "Terms", so if you want to edit your template file to show the "file_category" terms for each post, you would use get_the_terms() inside the loop. Documentation is here: http://codex.wordpress.org/Function_Reference/get_the_terms

To show all terms in a taxonomy (like the list of terms you mentioned you wanted to display) use http://codex.wordpress.org/Function_Reference/get_terms

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top