Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come creare tassonomie personalizzate in WordPress

Organizzare i contenuti di WordPress è facile con le categorie e i tag. Ma in anni di costruzione di siti WordPress, abbiamo imparato che le categorie e i tag predefiniti non sono sempre sufficienti per creare la struttura perfetta dei contenuti.

È qui che entrano in gioco le tassonomie personalizzate. Con le tassonomie personalizzate è possibile creare modi personalizzati per ordinare e raggruppare i contenuti.

Li abbiamo usati per organizzare qualsiasi cosa, dagli ingredienti delle ricette agli annunci immobiliari, e offrono un controllo e una flessibilità incredibili sulla categorizzazione di pubblicazioni, prodotti o qualsiasi altro contenuto.

In questa guida vi spiegheremo come creare tassonomie personalizzate in WordPress, sia che usiate un plugin sia che preferiate farlo manualmente.

How to create custom taxonomies in WordPress

Che cos’è una tassonomia di WordPress?

Una tassonomia di WordPress è un modo per organizzare gruppi di post e tipi di contenuto personalizzati.

Di default, WordPress è dotato di due tassonomie chiamate categorie e tag. È possibile utilizzarle per organizzare i post del blog.

Tuttavia, se si utilizza un post type personalizzato, le categorie e i tag potrebbero non essere adatti a tutti i contenuti.

Ad esempio, è possibile creare un post type personalizzato chiamato “Libri” e ordinarlo utilizzando una tassonomia personalizzata chiamata “Argomenti”. Poi si possono aggiungere termini come “Avventura”, “Romanticismo”, “Horror” e altri argomenti di libri.

Questo permette a voi e ai vostri lettori di ordinare e filtrare facilmente i libri per ogni argomento.

Le tassonomie possono anche essere gerarchiche, il che significa che si possono avere argomenti principali o genitori come “Narrativa” e “Saggistica”. Poi, sotto ogni categoria ci sono dei sottoargomenti, o figli/bambini.

Ad esempio, la categoria genitore “Fiction” potrebbe avere come figli/bambini “Adventure”, “Romance” e “Horror”.

Ora che sapete cos’è una tassonomia personalizzata, impariamo a creare tassonomie personalizzate in WordPress.

La creazione di tassonomie personalizzate è molto potente, ma c’è molto da coprire. Per aiutarvi a impostare correttamente il tutto, abbiamo creato un indice facile da seguire:

Pronti? Iniziamo!

Creare tassonomie personalizzate con un plugin (in modo semplice)

La prima cosa da fare è installare e attivare il plugin Custom Post Type UI. Per maggiori dettagli, consultate la nostra guida su come installare un plugin di WordPress.

In questa guida abbiamo già creato un tipo di post personalizzato e lo abbiamo chiamato “Libri”. Assicuratevi quindi di aver creato un tipo di post personalizzato prima di iniziare a creare le tassonomie.

Quindi, andiamo su CPT UI ” Aggiungi/Modifica tassonomie nell’area di amministrazione di WordPress per creare la prima tassonomia.

Creating custom taxonomy using plugin

In questa schermata è necessario eseguire le seguenti operazioni:

  • Creare lo slug della tassonomia (che sarà inserito nell’URL).
  • Creare l’etichetta plurale
  • Creare l’etichetta singolare
  • Autopopolazione delle etichette

Il primo passo è creare uno slug per la tassonomia da utilizzare nell’URL e nelle query di ricerca di WordPress. Si noti che uno slug può contenere solo lettere e numeri e sarà automaticamente convertito in lettere minuscole.

Successivamente, si inseriranno i nomi plurali e singolari della tassonomia personalizzata.

Da qui, è possibile fare clic sul link “Popola etichette aggiuntive in base alle etichette scelte”. In questo modo, il plugin compila automaticamente gli altri campi delle etichette.

A questo punto, si può scendere fino alla sezione “Etichette aggiuntive”.

In quest’area è possibile fornire una descrizione del post type.

Labeling your WordPress taxonomy

Queste etichette vengono utilizzate nella dashboard di WordPress quando si modificano e gestiscono i contenuti per quella particolare tassonomia personalizzata.

Segue l’opzione delle impostazioni. In quest’area è possibile impostare diversi attributi per ogni tassonomia creata. Ogni opzione ha una descrizione che ne illustra le funzioni.

Create custom taxonomy hierarchy

Nello screenshot qui sopra, si può notare che abbiamo scelto di rendere questa tassonomia gerarchica.

Ciò significa che la nostra tassonomia “Soggetti” può avere sotto-argomenti. Per esempio, un argomento chiamato “Fiction” può avere sotto-argomenti come “Fantasy”, “Thriller”, “Mystery” e altri ancora.

Ci sono molte altre impostazioni in fondo alla schermata della dashboard di WordPress, ma per questo tutorial potete lasciarle così come sono.

Ora è possibile fare clic sul pulsante “Aggiungi tassonomia” in basso per salvare la tassonomia personalizzata.

Dopodiché, è possibile modificare il post type associato a questa tassonomia nell’editor di contenuti di WordPress per iniziare a utilizzarlo.

Using taxonomy in post editor

Creazione manuale di tassonomie personalizzate (con codice)

Questo metodo richiede l’aggiunta di codice al vostro sito WordPress. Se non l’avete mai fatto prima, vi consigliamo di leggere la nostra guida su come aggiungere facilmente snippet di codice in WordPress.

Non consigliamo di modificare direttamente i file di WordPress, perché ogni minimo errore può distruggere l’intero sito. Per questo motivo consigliamo a tutti di utilizzare WPCode, il plugin di snippet di codice più semplice e sicuro che esista.

Per iniziare, è necessario installare e attivare il plugin gratuito WPCode. Per istruzioni dettagliate, consultate la nostra guida passo passo su come installare un plugin di WordPress.

1. Creare una tassonomia gerarchica

Cominciamo con una tassonomia gerarchica che funziona come le categorie e può avere termini padre e figli.

Una volta installato e attivato WPCode, si può navigare su Code Snippets ” + Add Snippet nella dashboard di WordPress.

Da qui è possibile passare del mouse su “Aggiungi codice personalizzato (nuovo snippet)” e cliccare sul pulsante “+ Aggiungi snippet personalizzato”.

Adding Custom Code in WPCode

Quindi, è necessario selezionare un tipo di codice dall’elenco di opzioni che appare sulla schermata.

Per questa esercitazione, scegliere “Snippet PHP”.

Select PHP Snippet as the code type

Successivamente, si accede alla pagina “Crea Personalizza Snippet”.

Iniziate inserendo un nome al vostro nuovo snippet di codice, che può essere qualsiasi cosa per aiutarvi a ricordare a cosa serve il codice.

Enter a snippet name and paste the code to create a hierarchical taxonomy

A questo punto, è sufficiente incollare il seguente codice nell’area “Anteprima codice”:

//hook into the init action and call create_book_taxonomies when it fires
 
add_action( 'init', 'create_subjects_hierarchical_taxonomy', 0 );
 
//create a custom taxonomy name it subjects for your posts
 
function create_subjects_hierarchical_taxonomy() {
 
// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI
 
  $labels = array(
    'name' => _x( 'Subjects', 'taxonomy general name' ),
    'singular_name' => _x( 'Subject', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Subjects' ),
    'all_items' => __( 'All Subjects' ),
    'parent_item' => __( 'Parent Subject' ),
    'parent_item_colon' => __( 'Parent Subject:' ),
    'edit_item' => __( 'Edit Subject' ), 
    'update_item' => __( 'Update Subject' ),
    'add_new_item' => __( 'Add New Subject' ),
    'new_item_name' => __( 'New Subject Name' ),
    'menu_name' => __( 'Subjects' ),
  );    
 
// Now register the taxonomy
  register_taxonomy('subjects',array('books'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_in_rest' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'subject' ),
  ));
 
}

Non dimenticate di sostituire il nome della tassonomia e le etichette nello snippet con quelle della vostra tassonomia. Si noterà anche che questa tassonomia è associata al post type Books. È necessario cambiarla con il tipo di post type con cui si desidera utilizzarla.

Quindi, scorrere verso il basso e accertarsi che nel pannello di inserimento siano selezionate le opzioni “Inserisci automaticamente” e “Esegui ovunque”.

WPCode Run Everywhere

A questo punto, si può tornare in alto nella pagina e attivare/disattivare l’interruttore da “Inattivo” a “Attivo”.

Infine, fare clic sul pulsante “Salva snippet” per rendere effettive le modifiche.

Activate and save your custom code snippet

2. Creare una tassonomia non gerarchica

Per creare una tassonomia personalizzata non gerarchica, come quella dei tag, si userà WPCode e si seguiranno gli stessi identici passi di cui sopra.

Solo che, al suo posto, utilizzerete questo codice:

//hook into the init action and call create_topics_nonhierarchical_taxonomy when it fires
 
add_action( 'init', 'create_topics_nonhierarchical_taxonomy', 0 );
 
function create_topics_nonhierarchical_taxonomy() {
 
// Labels part for the GUI
 
  $labels = array(
    'name' => _x( 'Topics', 'taxonomy general name' ),
    'singular_name' => _x( 'Topic', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Topics' ),
    'popular_items' => __( 'Popular Topics' ),
    'all_items' => __( 'All Topics' ),
    'parent_item' => null,
    'parent_item_colon' => null,
    'edit_item' => __( 'Edit Topic' ), 
    'update_item' => __( 'Update Topic' ),
    'add_new_item' => __( 'Add New Topic' ),
    'new_item_name' => __( 'New Topic Name' ),
    'separate_items_with_commas' => __( 'Separate topics with commas' ),
    'add_or_remove_items' => __( 'Add or remove topics' ),
    'choose_from_most_used' => __( 'Choose from the most used topics' ),
    'menu_name' => __( 'Topics' ),
  ); 
 
// Now register the non-hierarchical taxonomy like tag
 
  register_taxonomy('topics','books',array(
    'hierarchical' => false,
    'labels' => $labels,
    'show_ui' => true,
    'show_in_rest' => true,
    'show_admin_column' => true,
    'update_count_callback' => '_update_post_term_count',
    'query_var' => true,
    'rewrite' => array( 'slug' => 'topic' ),
  ));
}

Si noti la differenza tra i due frammenti di codice. Nella funzione register_taxonomy(), il valore dell’argomento hierarchical è impostato su true per le tassonomie di tipo category e su false per le tassonomie di tipo tag.

Inoltre, nell’array delle etichette per le tassonomie non gerarchiche, abbiamo aggiunto null per gli argomenti parent_item e parent_item_colon, il che significa che non verrà mostrato nulla nell’interfaccia utente per creare un elemento genitore o una tassonomia che può avere sottoargomenti.

Taxonomies in post editor

Anche in questo caso, assicurarsi di modificare il codice per includere le etichette personalizzate della tassonomia.

Visualizzazione delle tassonomie personalizzate

Ora che abbiamo creato le tassonomie personalizzate e abbiamo aggiunto alcuni termini, il vostro tema WordPress non li visualizzerà ancora.

Per visualizzarli, è necessario aggiungere del codice al tema di WordPress o al tema child. In particolare, questo codice deve essere aggiunto ai template dei file in cui si desidera visualizzare i termini.

È possibile aggiungere manualmente questo snippet ai file del tema, come single.php, content.php, archive.php o index.php. Per capire quale file dovete modificare, potete consultare la nostra guida alla gerarchia dei template di WordPress per istruzioni passo-passo.

Tuttavia, se non viene eseguita correttamente, questa operazione può danneggiare il sito, quindi consigliamo ancora una volta di utilizzare il plugin gratuito WPCode.

È necessario aggiungere il seguente codice nel punto in cui si desidera visualizzare i termini:

<?php the_terms( $post->ID, 'topics', 'Topics: ', ', ', ' ' ); ?>

Quindi, è sufficiente seguire i passaggi precedenti per incollare lo snippet in WPCode.

Ma alla voce Inserimento, si deve fare clic sul menu a tendina accanto a “Posizione” e selezionare il punto in cui si desidera visualizzare la tassonomia, ad esempio prima del post, dopo, o anche tra i paragrafi.

Select insertion location in WPCode

Per questa esercitazione, selezioneremo “Inserisci dopo il post”.

Nell’immagine qui sotto potete vedere come apparirà sul vostro sito live.

Custom Taxonomy Displayed

Aggiunta di tassonomie per i post personalizzati

Ora che sapete come creare tassonomie personalizzate, mettiamole in pratica con un esempio.

Creeremo una tassonomia e la chiameremo “Saggistica”. Poiché abbiamo un post type personalizzato chiamato “Libri”, è simile a come si crea un normale post di un blog.

Nella vostra Bacheca di WordPress, potete navigare su Libri ” Soggetti per aggiungere un termine o un argomento.

Adding a term for your newly created custom taxonomy

In questa schermata sono presenti 4 aree:

  • Nome
  • Slug
  • Genitore
  • Descrizione

Nel campo del nome, si scriverà il termine che si vuole aggiungere. È possibile saltare la parte dello slug e fornire una descrizione per questo particolare termine.

Infine, fare clic sul pulsante “Aggiungi nuovo soggetto” per creare la nuova tassonomia.

Il nuovo termine aggiunto dovrebbe apparire nella colonna di destra.

Term added

Ora avete un nuovo termine da utilizzare nei vostri blog. È anche possibile aggiungere termini direttamente durante la modifica o la scrittura di contenuti in quel particolare post type.

Basta andare su Libri ” Aggiungi nuovo per creare una pubblica.

Nell’editor della pubblicazione, troverete l’opzione per selezionare o creare nuovi termini nella colonna di destra.

Adding new terms or select from existing terms

Dopo aver aggiunto i termini, si può procedere alla pubblicazione del contenuto.

Tutte le pubblicazioni archiviate sotto quel termine saranno accessibili sul vostro sito web utilizzando il proprio URL. Ad esempio, i file archiviati sotto l’argomento “Fiction” appariranno al seguente URL:

https://example.com/subject/fiction/

Taxonomy template preview

Ora che avete creato le tassonomie personalizzate, potreste volerle visualizzare nel menu di navigazione del vostro sito web.

Si deve andare su Aspetto ” Menu e selezionare i termini che si desidera add-on nella scheda della tassonomia personalizzata che appare sul lato sinistro della schermata.

Adding terms to navigation menu

Non dimenticate di fare clic sul pulsante “Salva menu” per salvare le impostazioni.

Ora potete visitare il vostro sito web per vedere il vostro menu in azione.

Adding custom taxonomy in navigation menu

Per maggiori dettagli, potete fare riferimento alla nostra guida passo-passo su come creare un menu a discesa in WordPress.

Video tutorial

Se preferite guardare e imparare a creare tassonomie personalizzate, consultate il nostro video tutorial:

Subscribe to WPBeginner

Bonus: Approfondire le tassonomie di WordPress

Le tassonomie personalizzate consentono di fare moltissime cose. Ad esempio, è possibile mostrarle in un widget della barra laterale o aggiungere icone di immagini per ogni termine.

È inoltre possibile creare tassonomie personalizzate e consentire agli utenti di iscriversi a singoli termini. In questo modo, i lettori riceveranno aggiornamenti solo sui contenuti specifici che interessano loro.

Se volete personalizzare il layout delle vostre pagine tassonomia personalizzate, potete selezionare SeedProd. È il miglior costruttore di pagine e temi di WordPress con trascinamento e rilascio che consente di creare layout personalizzati senza alcun codice.

Select three column layout

Per saperne di più, potete consultare il nostro articolo su come creare una pagina personalizzata in WordPress.

Speriamo che questo articolo vi abbia aiutato a capire come creare tassonomie personalizzate in WordPress. Potreste anche consultare le nostre guide su come add-on le immagini delle tassonomie (icone delle categorie) in WordPress e su come modificare, spostare ed eliminare correttamente le categorie di WordPress.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

111 commentiLeave a Reply

  1. I tried putting this in a site-specfic plug-in and get the following in a box at the top:
    y() expects parameter 1 to be a valid callback, function ‘create_topics_hierarchical_taxonomy’ not found or invalid function name in /home2/kaibabpr/public_html/wp-includes/class-wp-hook.php on line 286

    Warning: Cannot modify header information – headers already sent by (output started at /home2/kaibabpr/public_html/wp-includes/class-wp-hook.php:286) in /home2/kaibabpr/public_html/wp-admin/includes/misc.php on line 1198

    as this is the first time I tried this, I’m at a loss.

    • You may want to ensure your site-specific plugin is a php file after you added the code as sometimes your operating system can try to edit the file type.

      Admin

  2. Thanks for sharing this code. I used non-hierarchy code, and admin part is working fine. I have created a separate template as well like taxonomy-[taxoName]-.php But while trying to access the URL, giving HTTP error 500. I have tried multiple things, like new cache starts, permalink re-save, new .htaccess and memory increase. even then page is not working. kindly help

  3. Hi,
    than you for this useful information, iam new to wordpress and i wanted to know the meaning thats i landed here, it was actually helpful.

    Best Regards

    Joseph Peter

  4. I used the code for adding a tag to a custom post type. Luckily Topics is exactly the label I needed so all I needed to change was post to lesson (I am modifying the LifterLMS lesson post type).

    Now I want to display the tags. I tried using the default WordPress Tag Cloud but it does not change to the newly added tag. It continues to show all my post tags even when I choose Topics

    Is there a step I am missing? How do I display the new tag: Topics?

  5. Taxonomies don’t behave exactly like default posts’ categories. They don’t appear in the URL (especially for nested taxonomies). Is there any way to set a custom taxonomy associated to a custom post type to behave like posts’ categories ?

  6. I have used this code in my gallery custom post type for category support. It shows the name of the category but when i click on the category name it shows 404:error not found. Please help me to solve it. I want the category posts to show on my archive.php page.

  7. Hi, I created custom meta box with new category. I can also show it to the post page. But when I click to the newly created category item it gives a 404 page. I wan it to work like tags, default category or author. So that If I click it shows all the post under that category.

  8. Hello,

    I am new to WordPress and coding in general. This tutorial is very well explained, thank you.

    However I don’t understand how to display the terms of my taxonomy on my pages.
    Where do I have to go to “Add this single line of code in your single.php file within the loop” ?

    Thank you for your help
    Best,
    Olivier

  9. Thank you so much for this great tutorial!
    I created custom taxanomy on my website dedicated to books and now I’m able to filter books by authors!

  10. The trouble with some plugins is that they may not be compatible with all themes. I have found that it pays to have a qualified developer do his/her part and test and troubleshoot any Web site alteration after adding a plugin or updating WordPress to a newer version to ensure everything works as it should.

  11. Man you are a legend,
    i struggled 3 days to get this, which i found in many websites, but not as clear as this.
    Thanks!

      • I have used this code in my gallery custom post type for category support. It shows the name of the category but when i click on the category name it shows 404.php page. Please help me to solve it. I want the category posts to show on my archive.php page.

  12. I’ve created a custom post type and a taxonomy to go with it, but when I create a custom post and add tags to it they don’t show up like normal tags do on normal posts. How do I get them to display at the bottom of the post like normal so people can click on them and find more like it?

    Thank you!
    -Ayla

  13. Hi everybody! First of all thank you for this article!
    I’ve found that “Simple Taxonomies” plugin is kind of out of date, since it hasn’t been updated since 2 years…. do you have any other plugin to suggest to create custom taxonomies?
    thanks :-)
    Giulia

    • I’m not the author of this post, but I use “Custom Post Type UI” to create custom taxonomies. With 300k installs, I’m pretty sure this plugin is as close as you can get to industry standard.

      Hope this helps!

  14. Hello,

    The description is not prominent by default; however, some themes may show it. But still show on front.

    How to hide taxonomy description from front ?
    I want to add description on taxonomy but i don’t want they show on front .

    Please tell me about what i can do.

    Thank You

  15. The article is OK, but the video is very poor. The sound quality is bad, she talks way too fast, obvious things are elaborated on but the explanation of what you’re doing and why is missing, as is the other content in the lower portion of the article.

  16. I am working on a WordPress website. I created categories using a plugin called “Categories Images”. One of the categories is named “Videos” so there is one folder/category that is supposed to show videos but images. The problem is, because the plugin is designed to upload images only, the YouTube videos do not show up. How can I edit the PHP files (create a custom taxonomy, edit single.php, edit taxonomy-{taxonomy-slug}.php, etc.) so that the post can show and play YouTube videos??

    • If you want more control over how things are pulled from the backend to the frontend look into using the Advanced Custom Fields plugin. This is a plugin for developers (so some code is involved) but its very powerful for things like what you ask

  17. Hi I have followed the manual way of creating custom taxonomy and i just used Ads/Ad instead of Topics/Topic . But i don’t see any custom taxonomy in post editor though i checked the custom taxonomy form Screen Options.

    though the custom taxonomy(Ads) is showing in admin submenu under Posts.

    • Here is my code snipped in functions.php file

      _x( ‘Ads’, ‘taxonomy general name’ ),
      ‘singular_name’ => _x( ‘Ad’, ‘taxonomy singular name’ ),
      ‘search_items’ => __( ‘Search Ads’ ),
      ‘all_items’ => __( ‘All Ads’ ),
      ‘parent_item’ => __( ‘Parent Ad’ ),
      ‘parent_item_colon’ => __( ‘Parent Ad:’ ),
      ‘edit_item’ => __( ‘Edit Ad’ ),
      ‘update_item’ => __( ‘Update Ad’ ),
      ‘add_new_item’ => __( ‘Add New Ad’ ),
      ‘new_item_name’ => __( ‘New Ad Name’ ),
      ‘menu_name’ => __( ‘Ads’ ),
      );

      // Now register the taxonomy

      register_taxonomy(‘ads’,array(‘post’), array(
      ‘hierarchical’ => true,
      ‘labels’ => $labels,
      ‘show_ui’ => true,
      ‘show_admin_column’ => true,
      ‘query_var’ => true,
      ‘rewrite’ => array( ‘slug’ => ‘ad’ ),
      ));

      }

      ?>

  18. Hy Dear WPBEGINNER SUPPORT,

    I have learned many things in this tutorial next time will you please elaborate functions parameter which you have used some time i got in trouble or confused with parameters.

    Thanks a lot Nice tutorial 5 rating

  19. Is there a way to get multiple custom taxonomy to use the same slug or same url? Please show us how if you or anyone knows.

  20. It may sound obvious, but…remember to refresh the permalink cache or you can waste some hours trying to figure out why archive pages don’t work…

    • Thank you very much!!!
      I wasted hours in debug mode, but cannot determine why my permalink redirects to 404 page! But after flushing “permalink cache” all works fine.
      Thank you again!

  21. Hello.

    How can I get a different Posts Link? I mean I want to get 2 different links after I published a New Post.

    E.G:

    Category Name – > Facebook (theme template A)

    Topic Name – > Twitter (theme template B)

    Then I submit a post to these 2 Categories. I want get 1 link for “Facebook” and 1 Link for “Twitter”.

    Best Regards

  22. I’m building a site which has multiple item thumbnails, each of which leads to a page with multiple images for that item (i.e. product). Are taxonomies the way to go or should I be looking at something else?

  23. Hi This is a great tutorial. But what if I want to display a custom taxonomies as posts in my menu? for instance I have a custom post type called ‘poems’ and custom taxomies classic, modern, new wave. each poem post is assigned one of these taxonomies. In the menu I want to see a menu entitled poems with 3 subheadings (classic, modrn, new wave). Each will display only the poems tagged with one taxonomy. Is this possible?

  24. This is great! How do I create “related posts” for the custom taxonomy?

    I’m assuming I need to put a conditional php code to display related posts for the new custom taxonomy to appear only when it’s a new taxonomy post and to hide when it is a basic category/tag post since they are both sharing the same content.php file.

    Any suggestions would be greatly appreciated.

  25. I used the code above to create the custom taxonomy – everything worked great. The field was added to all of my posts, and I populated it accordingly.

    I’m using the “Taxonomy Dropdown Widget” plugin – that works too.. sort of.

    The dropdown is populated correctly, but when you click on one of the items to display those posts, I get a 404. However the plugin works for displaying tags.

    Any ideas? I’ll be happy to post my code, just wasn’t sure if I paste it in here or somewhere and link to it here instead.

    Let me know.. thanks!

    SteveMTNO

    • Go to Setting > Permalinks > Save Changes
      (don’t need to make any changes, this just rewrites your .htaccess file so the link works)
      This step should be included in the post?

  26. Hi, can you recommend a different taxonomy plugin that works?
    Even a premium version, the one you’ve posted hasn’t been updated in months and the author seems to have done one.

    • The plugin works great, and the author has 19 other plugins. It also has great reviews and we have personally tested and used it. However, if you would still like to try some other plugin, then you can look at GenerateWP which will allow you to generate the code for your custom taxonomy. You can then paste this code in your theme’s functions.php file or a site-specific plugin.

      Admin

  27. I am beginner using classifieds wordpress theme my taxonomy list is not working correctly
    when i select country it shows correct bt when i select state it shows state list with city list when i select city i doesnot show below the parent how can i solve it without using plugin please help me

  28. This is probably a newbie question, but I can’t find the answer anywhere. I want to display the hierarchical path of each page at the top of the page. This page for example has “WPBEGINNER» BLOG» TUTORIALS» HOW TO CREATE CUSTOM TAXONOMI…” at the top and each item is a link. I lack the web vocabulary to know what this is called. If anyone can tell me what terms to search for to figure out how to do this that would be excellent.

    • Joe these are called breadcrumbs. You can add breadcrumbs to your site using Yoast’s WordPress SEO Plugin. You can also search for breadcrumbs on WordPress plugin directory to find other plugins.

      Admin

  29. I was getting 404 after manually setting up a custom taxonomy with your instructions and code. For anybody else who does, below is the solution I found on Codex.

    “If your site uses custom permalinks, you will need to flush your permalink structure after making changes to your taxonomies, or else you may see a “Page Not Found” error. Your permalink structure is automatically flushed when you visit Settings > Permalinks in your WordPress dashboard. “

    • I was getting the same 404 issue after making the taxonomy change. Flushing the permalinks worked perfectly.. thanks!

  30. Hello, thank you for the great article.

    Is there anyway to create a page for a custom taxonomy?

    Right now my custom taxonomy is called “issue” and I want to display all issue 1 posts on the home page. The problem is, the link looks like this example.com/issue/1 which is fine. Except that there is no way to make wordpress register this as the home page

    Thanks

  31. How can I display each taxonomy on separate pages?

    For example//

    PSDS (page)
    —Vampire Diaries
    ——–Elena Gilberts
    ——–Stephen
    ——–Damon
    ——–Klaus

    —Teen Wolf
    ——–Derek Hale
    ——–Scott McCall
    ——–Stiles Stilinski
    ——–Lydia Martin

    How could I display each character on their own page using taxonomies?

    I used “psd_categories” for the taxonomy, then I added “Teen Wolf” as a category.
    I found a way to display links to the show’s page, but I have no idea on how to display all posts under each characters name…
    I’m extremely new to this so please bare with me lol.

    Can I send an email perhaps? >.<

  32. Is there a way to make the categories not hyperlinks? I just want them listed. I don’t want them to link anywhere.

  33. thanks for the easy-to-understand tutorial :D

    and could you help me to insert those custom taxonomies into the post class? like, for example… when we put a category named ‘tutorial’ into the post, the category would normally get inserted in the post class as ‘category-tutorial’, right? but it seems the example from this article doesn’t do that.

    Once again, thanks for this great article.

    P.S: I choose the manual way to create the custom taxonomies, since I prefer not to use additional plugins for my site if possible.

  34. Hello and thanks for this information.

    I am using the Responsive Child Theme on WP 3.5.1 on DreamHost.

    I am building a WordPress site for a small print publication. I am trying to get my WordPress pages (not posts) to display the names of authors of articles that are on the pages. I installed the Simple Taxonomy plugin and created a custom taxonomy. I set it to work on pages and media, but not on posts. Using the widget for Simple Taxonomies I was able to have the author names show up on the right sidebar.

    The custom taxonomy shows up on the Edit Page admin panel and seems to permit me to select authors to associate with a page… But, after updating the page the authors don’t appear on the HTML page.

    I followed your suggestion and pasted some code into what I believe is the Loop (not sure if pages have the loop) and it didn’t change anything.

    I would appreciate any suggestions for dealing with this. / Robby, Seattle, USA

    • The pages do have loop, and yes you would have to paste the code to make sure the taxonomy appears on the HTML page. Email us the page.php file or where you added the code. Use our contact form.

      Admin

  35. Hi, in the code example, I am missing how you link the “topic” custom taxonomy to the “books” custom post type… Should I replace “post” with “books”?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.