Default Event Type
-
How do I change the default event type? When the form loads, Networking Event – In-Person is already selected and you can’t even see that there is a dropdown. I want to change the default.
The page I need help with: [log in to see the link]
-
Hello @lswebs ,
I had check on given link in above thread, it is working perfect. You can see the video which we create for your site testing.
https://www.awesomescreenshot.com/video/18809476?key=1846414a718d71069a47a9762568736e
Thank you.
My question was how do I change the default event type? I do not want what it is currently defaulting to. I would like it to default to Webinar.
Hi @lswebs ,
for that you need to customize code in template file : wp-content\plugins\wp-event-manager\templates\form-fields\term-multiselect-field.php
You need to override this file at your theme functions.php file and customize that overwritten file. you need to put proper condition that term is
if($field[‘taxonomy’]==event_listing_type){
$selected = <your_default_term_id>;
}
If you need any further help then please write your issue.
Thank you.
Sorry, but I really don’t understand what you are saying I need to do.
Specifically on this page https://www.nonprofit.courses/submit-event-form I want Event Type to default to Webinar.
Hi @lswebs ,
You need to first override template file : wp-content\plugins\wp-event-manager\templates\form-fields\term-multiselect-field.php
You can read doc for How to override template file from : https://wp-eventmanager.com/knowledge-base/how-override-archive-template/
In your theme side template file term-multiselect-field.php, you need to add code on line no.12
if($field[‘taxonomy’]==event_listing_type){
$selected = 1390;
}
This will definitely resolve your issue.
Thank you.
Thanks for your help, that made sense to me and I think I did what you wrote, but it did not change the default.
I copied term-multiselect-field.php into wp-content/themes/lifterlms-launchpad/wp-event-manager. I then copied the code above. But the default on the form still remains as Networking Event – In Person.
I’ll copy the code I have here:<?php // Get selected value if (isset($field['value'])) { $selected = $field['value']; } elseif (!empty($field['default']) && is_int($field['default'])) { $selected = $field['default']; } elseif (!empty($field['default']) && ($term = get_term_by('slug', $field['default'], $field['taxonomy']))) { $selected = $term->term_id; } else { $selected = ''; } if($field['taxonomy']==event_listing_type) { $selected = 1390; } wp_enqueue_script('wp-event-manager-term-multiselect'); $args = array( 'taxonomy' => $field['taxonomy'], 'hierarchical' => 1, 'name' => isset($field['name']) ? $field['name'] : $key, 'orderby' => 'name', 'selected' => $selected, 'hide_empty' => false ); if (isset($field['placeholder']) && !empty($field['placeholder'])) $args['placeholder'] = $field['placeholder']; event_manager_dropdown_selection(apply_filters('event_manager_term_multiselect_field_args', $args)); if (!empty($field['description'])) : ?> <small class="description"> <?php echo esc_textarea($field['description']); ?> </small> <?php endif; ?>
Hi @lswebs ,
You must have to paste your file in “wp-content/themes/lifterlms-launchpad/wp-event-manager/form-fields”, not in “wp-content/themes/lifterlms-launchpad/wp-event-manager/”, this wi;; definitely resolve your issue. If you still getting issue then please open support ticket on : https://support.wp-eventmanager.com/portal/en/signin
Thank you.
Thanks, I am able to get Webinar as the default now. I got an error at first, so I had to put if($field[‘taxonomy’]==’event_listing_type’) instead.
One more question please! How do I change the default for Online Event from No to Yes?
Hi @lswebs ,
To change default value for “Online Event” for submit event, you need to add apply below filter(code) in your theme(or child theme) functions.php file.
add_filter('submit_event_form_fields', 'set_default_submit_event_form_fields'); function set_default_submit_event_form_fields($fields){ $fields['event']['event_online'] = array( 'label' => __('Online Event','wp-event-manager'), 'type' => 'radio', 'default' => 'yes', 'options' => array( 'yes' => __( 'Yes', 'wp-event-manager'), 'no' => __( 'No', 'wp-event-manager') ), 'priority' => 4, 'required'=>true ); return $fields; }
This code will resolve your query to select default value.We hope that you satisfying with our plugin functionality and support, So could you please give positive review with 5 start to our plugin.
Thank you.
- This reply was modified 1 year, 4 months ago by Rita Kikani.
Thanks, that worked perfectly!
- The topic ‘Default Event Type’ is closed to new replies.