[resolved] Custom Taxonomies: "Invalid Taxonomy" error and filtering problem (10 posts)

  1. tzeldin88
    Posted 6 years ago #

    Just in case anyone else is having the same problem I just spent the last 7 hours on, I thought I'd share this on the forum.

    I created a CUSTOM TAXONOMY in my functions.php for "Industries":

    function create_my_taxonomies() {
    			'hierarchical' => false,
    			'label' => 'Industries',
    			'query_var' => true,
    			'rewrite' => true
    add_action('init', 'create_my_taxonomies', 0);

    but two things were not working correctly:

    1) When editing a post, clicking the "Choose from the most used tags in Industries" link showed "Invalid Taxonomy".

    2) When viewing the "Industry" page that shows all the terms for that taxonomy, and the number of posts using each one.. clicking those count links goes to the list of posts (Edit Posts page) but failed to filter down to just posts with the term i had clicked. Instead it showed all posts.

    THE FIX:
    Finally i realized that, in my original code in functions.php, the Taxonomy Name (the first argument) must be all LOWERCASE! I had used initial caps ("Industries").

    That's probably obvious to most people, but I missed it. Hopefully this will help if you did too.

  2. Ciprian Tepes
    Posted 6 years ago #

    Thank you very much :)

  3. JMcIntyre
    Posted 6 years ago #

    Thanks :)

  4. outlierdesign
    Posted 5 years ago #

    I LOVE YOU!!!!!!!!!!!!!!

    You have NO idea how much insanity this saved me.

  5. andy_woz
    Posted 5 years ago #

    Can I add that there should be no spaces either. Thanks, I looked high and low as to why my custom tags were bent out of shape an the popular tag cloud wasn't appearing in the admin.


  6. vectyr
    Posted 5 years ago #

    You are a genius. I love you too. I am using the Custom Post Types Plugin and can confirm that the NAME needs to be in all lowercase letters, the Label can be whatever you want.

  7. toscho
    WCEU 2016 Contributor
    Posted 5 years ago #

    Underscores kill the tag box too.

  8. Scott
    Posted 5 years ago #

    Thank you!

  9. andyxmas
    Posted 5 years ago #

    brilliant - thankyou!

  10. glamhaus
    Posted 5 years ago #

    THANKS! I was wondering what was wrong with my listings!!

Topic Closed

This topic has been closed to new replies.

About this Topic