WordPress.org

Forums

Events Manager
[resolved] attach regular categories to events (9 posts)

  1. cfabrice
    Member
    Posted 2 years ago #

    Hello I'm trying to attach "regular" post category to events but I don't manage to do it.
    I tried to add the following code either in events-manager/em-posts.php and/ or in my functions.php file but without succes

    register_taxonomy_for_object_type('category', EM_POST_TYPE_EVENT);

    Any idea ?
    Thank you !

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

  3. cfabrice
    Member
    Posted 2 years ago #

    Thanks !
    I guess we will be able now to retrieve associated custom posts sharing the same taxonomy !
    Great plugin !

  4. cfabrice
    Member
    Posted 2 years ago #

    hello, just a pbl !
    I can assign the "post-category" to events, like I used to do with another custom taxonomy, but the pbl is that when we print the array in the calendar page (we want to get a monthly archive page listing events with the ajax monthly navigation on top) we get through printer ($cell_events) we don't see any custom taxonomy showing up !!!
    We need them, either the post-category, or another custom taxonomy because we need to display some associated data (image, some text) linked to another custom post type sharing this taxonomy with the event (there can be only one other custop post type for a taxonomy term).
    How can I get to this toxonomy id ?
    Thank you !

  5. cfabrice
    Member
    Posted 2 years ago #

    Or another possibility, as we can see in the array that the event-categories are in, would be to assign event-categories to posts - might be simpler...
    Thank you

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I answered you somewhere else just now, please don't ask the same question in various ways, preferably one thread per unrelated question

  7. cfabrice
    Member
    Posted 2 years ago #

    Sorry for this ! There was so many possibilities to do this.
    We managed but it is not very orthodox I guess:we just change
    something in line 5 of em-posts.php
    if( !defined('EM_TAXONOMY_CATEGORY') ) define('EM_TAXONOMY_CATEGORY','category'); // instead of if( !defined('EM_TAXONOMY_CATEGORY') ) define('EM_TAXONOMY_CATEGORY','event-categories');
    And then we were able to use the "post category" with the events.
    Thank you for your plugin !

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    i guess it could work (although it may produce errors since we try to creat a taxonomy with a name already in use). rather than edit our plugin, if you add

    define('EM_TAXONOMY_CATEGORY','category');

    to wp-config.php it'll do the same thing

  9. cfabrice
    Member
    Posted 2 years ago #

    Ok, I tried but no, this is not working with your last line of code. Doesn't matter !
    The site works with the trick of sharing the post category among events, and other custom posts but it would be more elegant and easier to publish on it if we were able to use our custom taxonomy (spectacle).
    In another thread you suggested me to follow this agelonwl's comment.
    So I will try and question on that thread if I have further questions. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic