Home › Forums › Calendar Products › Events Calendar PRO › Button for Users to Add Events
- This topic has 4 replies, 2 voices, and was last updated 8 years, 2 months ago by
Marsha Roscoe.
-
AuthorPosts
-
February 14, 2018 at 10:55 am #1453259
Marsha Roscoe
ParticipantIf I am on a listing page showing events for a particular category, how can I display a button on this page to allow users to submit an event? For example, on this page I have a button to allow users to submit events: https://www.lss-elca.org/congregations/. How can I add that same button to this page: https://www.lss-elca.org/events/category/community/list or even this page https://www.lss-elca.org/events/category/community/?
Thanks!
February 15, 2018 at 10:17 am #1454489Sky
KeymasterHi Marsha!
I would be happy to help you figure this out.
To add content such as a button to a particular view, you need to copy the original template from the plugin into your theme or child theme where you can modify it. See our Themer’s Guide for more information.
As far as targeting specific categories: There are not separate templates for categories, so you would need to add some conditional statements around your custom content within the template view you want to edit. For example, to add the button within the list view, you would copy and modify /list/content.php. However, I am unsure which conditionals will allow you to target a specific category. I have asked some of the more knowledgeable members of our support team about this, and I will follow up tomorrow after I’ve heard back.
Thank you for your patience.
SkyFebruary 16, 2018 at 10:01 am #1455610Sky
KeymasterMarsha,
I was able to find the correct conditional function thanks to one of my awesome coworkers.
To check if a certain category is selected before outputting markup into the template, you can use the following function:
has_term( 'your-category-slug', 'tribe_events_cat')
As an example if you wanted to output a message only when viewing events with the category “my-event-category”, you could do something like this:
This is the best category in the world!";
} else {
echo "This category is ok I guess.
";
}
?>
Let me know if this helps!
Thanks,
SkyMarch 10, 2018 at 8:35 am #1475541Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Button for Users to Add Events’ is closed to new replies.
