WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Showing custom taxonomies on recurring events page (25 posts)

  1. Jack
    Member
    Posted 11 months ago #

    Using the Custom Post Type UI I added some taxonomies to Events and Recurring Events. When I add an event, they show up on the normal events page (write), but nowhere on the Recurring Events page. This way I can't use a taxonomies filter in the front end because all recurring events are left out.

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

  2. angelo
    NetWebLogic Support
    Posted 11 months ago #

    sorry didn't quite get what you mean; is that you can't assigned categories to recurring events and/or filter recurring events by categories in the frontend using a shortcode or through search form?

  3. Jack
    Member
    Posted 11 months ago #

    I can show the categories for recurring events, but not the custom taxonomies I created for events.

    I created some custom taxonomies like:
    Day of the week (which include monday, tuesday etc.)
    Age (childres, grown-ups, elderly etc.)
    and more.

    I want to filter my events using these taxonomies for both normal events and recurring events, but these taxonomies only show up when adding an new normal event and not on the add recurring event page.

  4. angelo
    NetWebLogic Support
    Posted 11 months ago #

    here's another thread which may help you with this - http://wordpress.org/support/topic/events-manager-using-post-categories?replies=8

  5. Jack
    Member
    Posted 11 months ago #

    Yes, I know I can do that, but that doesn't put those taxonomies/categories on the Add New Event page like it does with regular events, like this: http://storage1.static.itmages.com/i/13/0906/h_1378472827_7697083_18ec5b7c38.png

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

  7. Jack
    Member
    Posted 11 months ago #

    I wasn't exactly clear in my previous reply, what I mean is that I've done all that, but that the new taxonomies don't show up on the Add New RECURRING Event admin page. They do show up on the normal Add New Event page, but not on the recurring admin page.

    Also they don't show up on the frontpage after the title 'Categories'.

  8. philipjohn
    Member
    Posted 11 months ago #

    Do you see the Categories box at all, or is the box there but empty?

    Thanks

  9. Jack
    Member
    Posted 11 months ago #

    The box is there if I wanted to, but empty. But I'm not using the regular categories of EM, but custom taxonomies: http://storage8.static.itmages.com/i/13/0906/h_1378476617_3303779_0277abe90a.png

    On the front page it says Categories, with nothing behind it: http://storage3.static.itmages.com/i/13/0906/h_1378476810_9791313_60e3f60cd9.png

  10. caimin_nwl
    NetWebLogic Support
    Posted 11 months ago #

    Can you post the code you're using for the Categories in your template?

  11. Jack
    Member
    Posted 11 months ago #

    <strong>Categorie├źn</strong>
    	#_EVENTCATEGORIES

    I also tried #_CATEGORIES.

    I think it comes down to EM not picking up my custom taxonomies I created with the Cutom Post Type UI plugin. But they show up fine in the taxonomy filter plugin I'm using: http://storage7.static.itmages.com/i/13/0907/h_1378555361_1110861_64a5f8e9dd.png

  12. Jack
    Member
    Posted 11 months ago #

    Are recurring events a seperate post type, just like 'events' and 'locations'?

    I didn't think so, so why can't I see my custom taxonomies on the add new recurring events admin page? I can use them just fine on the 'add new event' admin page.

    I'm really stuck with this :(

  13. philipjohn
    Member
    Posted 11 months ago #

    Are you sure you've added your taxomonies to the right custom post type?

    As Angelo requested, the code will help here...

  14. Jack
    Member
    Posted 11 months ago #

    As you can see here, they are listed, but not visible on the Add New Recurring Event page, just the regular Add New Event page:
    http://storage8.static.itmages.com/i/13/0906/h_1378476617_3303779_0277abe90a.png

    And what code do you mean? I didn't change anything in the default EM templates under templates/templates, and this is the code of a singel event page:

    <div style="float:right; margin:0px 0px 15px 15px;">#_LOCATIONMAP</div>
    <p>
    	<strong>Wanneer?</strong><br/>
    	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
    </p>
    {has_location}
    <p>Waar?</strong><br/>
    	#_LOCATIONLINK
    </p>
    {/has_location}
    <p>
    	<strong>Info:</strong>
    	#_EVENTCATEGORIES
    </p>
    <br style="clear:both" />
    #_EVENTNOTES
    {has_bookings}
    <h3>Bookings</h3>
    #_BOOKINGFORM
    {/has_bookings}
  15. Jack
    Member
    Posted 11 months ago #

    And here you can see it's attached to the right post type:

    http://storage5.static.itmages.com/i/13/0909/h_1378739895_1025689_95c2575307.png

  16. angelo
    NetWebLogic Support
    Posted 11 months ago #

    did you try something like this?

    register_taxonomy_for_object_type('custom_category','event-recurring');

    change custom_category with your taxonomy name

  17. Jack
    Member
    Posted 11 months ago #

    I just added this line to my functions.php and it's not appearing when I want to add a new recurring event.

    Could you please try it yourself, just to see what's going wrong?

    Easiest way would be to use the Custom Post Type UI, create a new taxonomy, and you'll see you can't attacht it to 'event-recurring', only to 'event'. Also the WCK plugin shows this same thing. A new taxonomy is only attachable to 'event' and not 'event-recurring'. Is event-recurring indeed a custom post type???

  18. philipjohn
    Member
    Posted 11 months ago #

    Ah I missed that you're using a plugin, not code, to create your taxonomies.

    Now I can see from your screenshot that you have not added the taxonomy to the recurring event post type. You need to add it to both the event and event_recurring post types.

    Thanks

  19. Jack
    Member
    Posted 11 months ago #

    But is event-recurring a Custom Post Type??? I don't think so, because both the Custom Post Type UI plugin and the WCK plugin let me attach my taxonomies just fine to the 'event' post type, but both can't 'see' another custom post type besides 'locations'.

    I also tried adding register_taxonomy_for_object_type('stad','event-recurring');
    to my functions.php. Nothing happened. (is it event-recurring or event_recurring? neither worked).

    I also tried all this 'manually' by using this: http://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/

    That also didn't work.
    Damn, why is this so hard!!! :(

  20. caimin_nwl
    NetWebLogic Support
    Posted 11 months ago #

    Yes, event-recurring is a custom post type. Can you post the code you used when trying to add it manually?

  21. Jack
    Member
    Posted 11 months ago #

    I tried this again, manually, inside functions.php, and for the post type 'event'. Even this doesn't add a new taxonomy to 'event'.

    add_action( 'init', 'create_event_tax' );
    
    function create_event_tax() {
    	register_taxonomy(
    		'testing',
    		'event',
    		array(
    			'label' => __( 'Testing' ),
    			'rewrite' => array( 'slug' => 'testing' ),
    			'hierarchical' => true,
    		)
    	);
    }
  22. caimin_nwl
    NetWebLogic Support
    Posted 11 months ago #

    You might want to try with priority added to the add_action - it could be it's running too soon, before the event custom post type is ready.

    Try something like this:

    add_action( 'init', 'create_event_tax', 50);

  23. Jack
    Member
    Posted 11 months ago #

    Nothing... :(

    But, I found something... When I look into the database for a recurring-event I just added, in the field post_type for this post I can see that it says 'event' and NOT 'recurring-event', as if this whole EM post type isn't registered correctly.

    That would also explain why the Custom Post Type UI plugin can't 'see' the event-recurring post-type and I'm unable to attache my newly created taxonomies to both events and recurring-events.

  24. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    unfortunately, due to the way recurrences work programatically, custom taxonomies for recurring events probably won't work as they don't get copied to the individual recurrences.

    not much we can do about this, we intend to rewrite recurrences in the near future so this sort of thing will get sorted out, but until then (no ETA yet) the only option is to custom code something and use the em_event_save_events filter.

  25. Jack
    Member
    Posted 11 months ago #

    Damn! There goes the whole structure and navigation for my events :( :(
    And I'm no coder, so I have no idea where to begin with what you suggested...

    I bought this plugin: http://codecanyon.net/item/taxonomies-filter-widget/4282257

    It would be the perfect companion for EM, so I can just hope that the rewrite will come someday. Not soon enough for my current project though, so I'll have to think of something else. Perhaps using regular parent child categories instead and see if that works. Thanks for the explanation. Could have come a little sooner ;) because I have been struggling with this for days :(.

  26. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 11 months ago #

    sorry, haven't had time to visit the free forums this week :|

  27. elliotlewis
    Member
    Posted 1 day ago #

    This still looks to be the same? Custom Taxonomies can't be used on Repeating Events.

    This is a big problem as, it makes the ability to add custom taxonomies almost redundant. You highlight the feature in your docs as something that can be done but neglect to say it doesn't work for repeating events. Similar to Jack completely messed up what Iv'e built so far.

    http://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/

    Are Event Categories normal CT? If not do you plan to make them so any number ofCT can be used for both normal and repeating events?

Reply

You must log in to post.

About this Plugin

About this Topic