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

Come creare tassonomie personalizzate in WordPress

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Volete creare tassonomie personalizzate in WordPress?

Per impostazione predefinita, WordPress consente di organizzare i contenuti con categorie e tag. Ma con le tassonomie personalizzate è possibile personalizzare ulteriormente l’ordinamento dei contenuti.

In questo articolo vi mostreremo come creare facilmente tassonomie personalizzate in WordPress con o senza l’uso di un plugin.

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 post personalizzati.

Per impostazione predefinita, WordPress dispone di due tassonomie chiamate categorie e tag. È possibile utilizzarle per organizzare i post del blog.

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

Ad esempio, è possibile creare un tipo di post personalizzato chiamato “Libri” e ordinarlo utilizzando una tassonomia personalizzata chiamata “argomenti”.

È possibile aggiungere termini tematici come Avventura, Romanticismo, Horror e altri argomenti di libri. Questo permetterà 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 capostipiti, come Narrativa e Saggistica. Poi ci sono i sottoargomenti, o figli, sotto ogni categoria.

Ad esempio, la categoria madre Narrativa potrebbe avere come figli Avventura, Romanticismo e Horror.

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

La creazione di tassonomie personalizzate è potente, ma c’è molto da fare. Per aiutarvi a configurarle correttamente, abbiamo creato una semplice tabella di contenuti qui di seguito:

Creare tassonomie personalizzate in WordPress (esercitazione video)

Subscribe to WPBeginner

Se preferite le istruzioni scritte, continuate a leggere.

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, andare alla voce di menu 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. Questo slug viene utilizzato nell’URL e nelle query di ricerca di WordPress.

Può contenere solo lettere e numeri e verrà 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, scorrere fino alla sezione “Etichette aggiuntive”. In quest’area è possibile fornire una descrizione del tipo di post.

Labeling your WordPress taxonomy

Queste etichette vengono utilizzate nella dashboard di WordPress durante la modifica e la gestione dei 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

Nella schermata 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 soggetto 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é, si può modificare il tipo di post associato a questa tassonomia nell’editor di contenuti di WordPress per iniziare a usarlo.

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, potete andare su Code Snippets ” Add Snippet nella vostra dashboard di WordPress.

Passare il mouse su “Aggiungi il tuo codice personalizzato (nuovo snippet)” e fare clic su “Usa snippet”.

Add a new custom snippet in WPCode

Successivamente, si aprirà la pagina “Crea snippet personalizzato”. È sufficiente dare un nome al nuovo snippet e incollare il seguente codice nell’area di testo.

//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' ),
  ));
 
}

Assicurarsi di cambiare il tipo di codice in “Snippet PHP” e di spostare l’interruttore su “Attivo”.

Add custom taxonomy with WPCode

Non dimenticate di sostituire il nome della tassonomia e le etichette nello snippet con le etichette della vostra tassonomia. Si noterà anche che questa tassonomia è associata al tipo di post Books, che dovrà essere cambiato con il tipo di post che si desidera utilizzare.

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

WPCode Run Everywhere

Una volta terminato, è possibile scorrere indietro fino alla parte superiore e fare clic sul pulsante “Aggiorna” per rendere effettive le modifiche.

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 passi di cui sopra, solo che si userà 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 padre 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 figlio.

Questo codice dovrà essere aggiunto ai file dei template 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, consultate la nostra guida alla gerarchia dei template di WordPress per maggiori dettagli.

Tuttavia, se non viene eseguita correttamente, questa operazione può danneggiare il sito, per cui 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: ', ', ', ' ' ); ?>

Seguire i passi 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.

WPCode Insertion box

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 tipo di post personalizzato chiamato “Libri”, è simile a come si crea un normale post di un blog.

Nella dashboard di WordPress, andare 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
  • Lumaca
  • Genitore
  • Descrizione

Nel nome, si scriverà il termine che si desidera aggiungere. È possibile saltare la parte dello slug e fornire una descrizione per questo termine particolare (opzionale).

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

Il nuovo termine aggiunto apparirà ora nella colonna di destra.

Term added

Ora avete un nuovo termine da utilizzare nei vostri post.

È anche possibile aggiungere termini direttamente durante la modifica o la scrittura di contenuti in quel particolare tipo di post.

È sufficiente andare alla pagina Libri ” Aggiungi nuovo per creare un post. Nell’editor del post, troverete l’opzione per selezionare o creare nuovi termini dalla colonna di destra.

Adding new terms or select from existing terms

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

Tutti i post archiviati sotto quel termine saranno accessibili sul vostro sito web con un proprio URL. Ad esempio, i post archiviati sotto l’argomento Narrativa 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.

Andare su Aspetto ” Menu e selezionare i termini che si desidera aggiungere alla scheda tassonomia personalizzata che appare sul lato sinistro dello schermo.

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, consultate la nostra guida passo-passo su come creare un menu a discesa in WordPress.

Approfondire le tassonomie di WordPress

Le tassonomie personalizzate possono essere utilizzate in moltissimi modi. Ad esempio, si possono mostrare in un widget della barra laterale o aggiungere icone di immagini per ogni termine.

È anche possibile aggiungere un feed RSS per le tassonomie personalizzate in WordPress e consentire agli utenti di iscriversi ai singoli termini. In questo modo, i vostri lettori riceveranno solo aggiornamenti sui contenuti specifici che interessano loro.

Se volete personalizzare il layout delle vostre pagine di tassonomia personalizzate, potete dare un’occhiata a SeedProd. Si tratta di un costruttore di pagine e temi WordPress drag-and-drop che consente di creare layout personalizzati senza alcuna codifica.

Speriamo che questo articolo vi abbia aiutato a capire come creare tassonomie personalizzate in WordPress. Potreste anche voler consultare la nostra guida su come tracciare i visitatori di un sito web e su come creare un tema WordPress personalizzato senza scrivere alcun codice.

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

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

112 commentiLascia una risposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    Thank you for the clear instructions. I would like to make my own taxonomy for tutorials on the site. This tutorial is great and clear, thanks.

  3. Kira says

    Hello.
    I don’t understand this part:

    ID, ‘topics’, ‘Topics: ‘, ‘, ‘, ‘ ‘ ); ?>

    I mean, should I paste exactly that part into my loop-single.php?
    I’m using a taxonomy called “writer”

    • WPBeginner Support says

      It would depend on where you want to display the terms, normally it would be added to the single.php.

      Admin

  4. Wolfgang says

    Hi,
    I used your article to create a CPT with a hierarchical and a non-hierarchical taxonomy attached to it. I created a few entries and it all seems to be working fine. Both taxonomies display fine in their respective archive pages. One thing I noticed though when I tried to add the taxonomies to the menu was that the non-hierarchical taxonomy was available in the “Add menu item” column but the hierarchical taxonomy was NOT.
    Is that an expected behavior? If not what could be going wrong?
    Thanks

    • WPBeginner Support says

      The most common issues you could check would be that you have published content in the taxonomy and you may want to test adding a different content type to test if it is an issue with the taxonomy or something else.

      Admin

  5. mb says

    what does this line do
    ‘menu_name’ => __( ‘Subjects’ ),

    is this in order to add taxonomies to the menu

    • WPBeginner Support says

      You would want to check under your preferences to ensure it is not hidden for your user.

      Admin

  6. Gina Wilson says

    This tutorial and specifically the part of how to display the custom taxonomy was a lifesaver! I’m very much a beginner and this was very helpful in understanding where I went wrong in my coding.

    Thank you!!!

  7. Bruno Oliveira says

    Awesome tutorial! i have one question. how do i use my new taxonomy slug as permalink like category (/%category%/%year%/%monthnum%/%day%/%postname%/)

    I want something like /%custom_taxonomy%/%year%/%monthnum%/%day%/%postname%/

    i keep getting 404 error

    • WPBeginner Support says

      That is not something WordPress would allow by default and would require some custom coding to set up.

      Admin

  8. vikas says

    i tried the plugin method , it sucessfully created a new category in custom post type but it is not showing on my posts like tags and other categoties. can you help me with that?

    • WPBeginner Support says

      You would want to reach out to the support for your specific theme for customizing the display to include your taxonomy.

      Admin

  9. Richard says

    I am creating a podcast network where I have multiple podcasts on a single site with episodes under each individual podcast. Would something like this work for that? I really don’t want to go the multi site route.

    • WPBeginner Support says

      You can certainly use this should you want or another option would be to create a custom post type depending on your preference.

      Admin

  10. Maria says

    Hello is possible add the custom taxonomies to a custom product type?

    I create a custom product call drinks and i have several taxonomies like country, material and etc

    I want when the user click in drinks then only apperas those taxonomies, is this posiible?

  11. Mike Smith says

    this code works great on my site for work. Can you tell me how to add the custom taxonomy into the site’s rss feed?

  12. angela says

    thank you for taking the time to post this, this was the first site that actually explained this and it made sense, haha. im a happy camper now

    • WPBeginner Support says

      It would depend on which method you used to create the custom taxonomy, if you’re using the plugin you would want to reach out to the plugin’s support to make sure they have show_in_rest set to true for seeing it in the block editor.

      Admin

      • Jem says

        No, I am not using any plugin. I have just copy paste your snippet. Its create new taxonomy. But it is not display in post editor page like category, tags display on rightside panel.

        Can you please guide me how can I show custom taxonomy in post editor page?

        • WPBeginner Support says

          In the register_taxonomy array, you would want to first try adding a new line with the code below:
          ‘show_in_rest’ => true,

  13. Jim Gersetich says

    The first half of this post is completely useless. the Simple Taxonomy plugin doesn’t work with the current WordPress version, and it hasn’t been updated in four years.

    Please try to find another plugin and change that section to go with the new one.

    • WPBeginner Support says

      Thank you for letting us know, we’ll certainly take a look at updating this article.

      Admin

  14. joe barrett says

    Don’t forget to add ‘show_in_rest’ => true,
    if you want to use your custom items in rest api to $args

  15. Michael Morad-McCoy says

    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.

    • WPBeginner Support says

      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

  16. Suresh says

    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

  17. Joseph Peter says

    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

  18. Cindi Gay says

    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?

  19. Ero says

    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 ?

  20. Rangan Roy says

    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.

    • Utshab Roy says

      I got this same problem that you are facing. The way I solved it is very easy. Go to your permalink settings and click the save button. Refresh the page. This simple step will save the issue.

  21. Russell says

    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.

  22. Olivier says

    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

  23. Azamat says

    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!

  24. James Angel says

    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.

  25. paul says

    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!

      • Rangan Roy says

        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.

  26. Ayla says

    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

  27. Giulia says

    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

    • Mario says

      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!

  28. Sunny says

    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

  29. Charles Hall says

    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.

  30. Jennifer says

    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??

    • Jamie Wallace says

      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

  31. Muhammad says

    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.

    • Muhammad says

      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’ ),
      ));

      }

      ?>

  32. Abdul Rauf Bhatti says

    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

  33. lee says

    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.

  34. pdepmcp says

    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…

    • Ilya says

      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!

  35. winson says

    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

  36. foolish coder says

    how to create single pages / templates for taxonomies?

    I mean like single.php not like category.php

  37. Aalaap Ghag says

    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?

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.