Using core WP categories/tags

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 10 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42751

    Hello,

    Can I use standard WP Categories and Tags with events, instead of the custom ‘event-category’ taxonomy the plug-in uses?

    I want to share categories and tags across all post types, including ‘posts’ and ‘events. Is it possible to use default WP Categories or should I create a new custom taxonomy for this?

    Thanks for any help you can offer,
    Shaun

    Shaun Woods
    #42756

    It’s possible, but the plug-in won’t do anything with these taxonomies:

    function namespace_share_category_with_pages() {
        register_taxonomy_for_object_type( 'post_tag', 'event' );
        register_taxonomy_for_object_type( 'category', 'event' );
    }
    
    add_action( 'init', 'namespace_share_category_with_pages', 20);
    
    • This reply was modified 10 months, 1 week ago by  Stephen Harris. Reason: Fixed event CPT name
    Stephen Harris
    #42846

    Hi Stephen,

    Thank-you for your speedy reply and sorry it’s taken me a while to respond – some life-stuff got in the way.

    I tried adding that function, but it didn’t have any visible effect – neither Categories nor Tags were selectable from individual Event pages after I added it to functions.php. I checked under Screen Options, to no avail.

    I’m not sure if this is what you meant by the plug-in not doing anything with these taxonomies, but I thought I’d mention it, just in case. Failing this, I’ll try adding custom taxonomies across all post types, including events.

    Shaun Woods
    #42877

    Sorry Shaun, it should have been 'event' as the post type not 'eo_event'. I’ve fixed the original message.

    With regards to the plug-in not doing anything with those taxonomies, I mean just that they won’t be displayed by the plug-in (e..g. on event listings or calendars). The templates can be edited to add that, however.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.