• Resolved Aitor Méndez

    (@aitormendez)


    I’m trying to add a custom taxonomy with register_taxonomy function but the taxonomy is not availabe for events:

    register_taxonomy( 'area', array( 'post', ' event' ), $args );

    How can it be added?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Aitor Méndez

    (@aitormendez)

    I forgot to add

    
    'taxonomies' => array( 'area' ),

    To $args of

    register_post_type( 'event', $args ); in event-organiser-cpt.php:283

    Now the taxonomy is working and available for events. Is there some way to do it without modify the plugin code? I mean, if I write in the plugin, it can’t be updated anymore.

    • This reply was modified 6 years, 9 months ago by Aitor Méndez.
    Thread Starter Aitor Méndez

    (@aitormendez)

    Solved. Was a typo registering taxonomy. Space before ' event'.

    guillermovargasquisoboni

    (@guillermovargasquisoboni)

    Hi Aitor,

    It seems that you already make your own taxonomy but you are using the original files of event organiser. You can make a plugin for yourself, you just have to create a php file with a simple header and copy paste your code with your own taxonomy. The php file will begin with this header :

    <?php
    /*
    Plugin Name: Area for Event Organiser // this is just an idea of name
    Description: This plugin works with event organiser and original and it is intended to add a taxonomy with areas.
    */
    /* Start Adding Functions Below this Line */

    Right below you can add your own code and at the end you will close it with the php closing element ?>

    Thread Starter Aitor Méndez

    (@aitormendez)

    Thank you for the advice, Gillermo. I already have my custom taxonomy in a mu-plugin

    ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding custom taxonomy to event post type’ is closed to new replies.