Preventing Multiple Categories in 'Submit an Event'
-
Hello, I am having good success with Submit an Event.
I have a requirement to restrict the user from selecting multiple categories in their events. That is: Required to select one category but no more than one. I was able to set the field to ‘required’.
Is there a method available to code this up together with the ‘required’ flag?
Cheers,
Yehuda-
This topic was modified 4 months, 2 weeks ago by
Yehuda.
Correct AnswerHi Yehuda!
Thanks for getting in touch with us! Let me help you with this topic.
First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.
That said, we always like helping out and at least point users into the right direction as much possible.
I would suggest overriding the taxonomy.php template to make that happen. You can learn more about overriding calendar templates in our Themer’s Guide, but it basically boils down to this:
- Make a copy of the taxonomy.php template. It is located at wp-content/plugins/the-events-calendar-community-events/src/views/community/modules/taxonomy.php
- Make a new folder in your theme called tribe-events
- Make a new folder in that one called community and another on inside it called modules
- Drop your copied taxonomy.php file in that last folder
Now that the template is in your theme, you can modify it to suit your needs. In this case, You should delete line 91 which is the attribute “multiple” that allows for multiple selection of categories.
Will this work for you? Please let me know. 🙂
Best,
Victor -
This topic was modified 4 months, 2 weeks ago by
The topic ‘Preventing Multiple Categories in 'Submit an Event'’ is closed to new replies.