Facebook events not imported to a category in Events Calendar

Home Forums Calendar Products Event Aggregator Facebook events not imported to a category in Events Calendar

  • This topic has 3 replies, 4 voices, and was last updated 9 years, 8 months ago by Constantino Thamnopoulos.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1151447

    Hello there,

    I did a bit of research as I need to import our Facebook events to a specific category of events calendar.
    I have tried a series of code buy nothing seems to work, probably because Im not experienced on PHP.

    I need your help guys to make this functionality to work. Can you explain me “dummy” style how I can
    import all my facebook events to a specific category?

    #1151881
    Hunter
    Moderator

    Hello and welcome back,

    Try adding the following snippet to the bottom of your theme’s functions.php file and let me know how it goes.

    /**
    * The Events Calendar Facebook Events - Add Category to Imported Events
    * change Facebook Event to the name of the event category
    * @Version 4.0
    */
    add_action( 'tribe_events_facebook_event_created', 'tribe_fb_add_category' );
    function tribe_fb_add_category( $event_id ) {

    wp_set_object_terms( $event_id, 'Facebook Event', 'tribe_events_cat', false );

    }

    Change Facebook Event with the name of the category you would like to use. Have a great evening and thanks for choosing PRO. Cheers!

    #1160458
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Facebook events not imported to a category in Events Calendar’ is closed to new replies.