Events Plugin - Can you have Child event associated to a parent event

Hi,

We have a client that would like to use the events plugin to organise an event that has includes sub-events.

These are competitions that happen throughout the duration of the main event.

Our client would like to be able to enter the competitions not just the overall event. Is this possible within this plugin?

Thanks
Chris

  • aristath

    Hello there @Chris, I hope you're well today!

    We don't have exactly child-events, but there's a way you can make this work...
    Create a new event and make it recurring instead of one-time.
    Set a start and end date as well as its frequency and save.
    Once you save your event, you should now be able to see an "edit instances" link.
    Clicking on that link you'll see a list of all the instances of the event (which can be considered as child-events), and you'll be able to edit them separately.

    I hope that helps!

    Cheers,
    Ari.

  • Chris

    Hi Ari,

    Thanks for the reply. That features great but was I was really looking for was the ability to have sub-events within a main event.

    For example:

    The client has a horse riding event but withing the event there are some competitions that users can sign up for. What they are ideally looking for is the ability for people to enter these competitions but for all the info (Dates, times, images, etc) to be housed under the main event.

    Do you think that is possible?

    Thanks
    Chris

  • Ash

    Hello @Chris

    I hope you are well today.

    The client has a horse riding event but withing the event there are some competitions that users can sign up for. What they are ideally looking for is the ability for people to enter these competitions but for all the info (Dates, times, images, etc) to be housed under the main event.

    You can have child event with a couple of lines of codes, but you still need to write custom code to make this. Maybe using a custom archive template.

    To have child/parent events, please use the following code:

    add_filter( 'eab-post_type-register', 'ev_cpt_custom' );
    function ev_cpt_custom( $arr ){
    	$arr['hierarchical'] = true;
    	return $arr;
    }
    
    add_filter( 'eab-event-post_type-supports', 'ev_cpt_support' );
    function ev_cpt_support( $arr ){
    	$arr[] = 'page-attributes';
    	return $arr;
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag (<?php) at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Chris

    Hi Ash,

    Thanks for this. I've added the code into my functions.php file and I can see the ability to relate events to a parent events and I've got this pulling through into a custom template - which is great!

    The next issue i've run into is creating a form that allows registered users to create an event and then create these sub-events from the front-end of the website. Do you know if this is possible for the plugin or am I going to need to code a custom form? I'm not sure if there is another system/plugin that would allow me to create the form and then post data back into this custom plugin.

    Thanks
    Chris

  • Ash

    Hello @Chris

    I hope you are well today.

    Please download the attached file. You will see two files in there. Put the files according to the following:

    eab-events-front_page_editing.php = /wp-content/plugins/events-and-bookings/lib/plugins/
    eab-events-fpe.js = /wp-content/plugins/events-and-bookings/js/

    Please check now.

    Please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.