Home › Forums › Calendar Products › Events Calendar PRO › A hook to add custom link in events calendar page
- This topic has 8 replies, 2 voices, and was last updated 7 years, 7 months ago by
Linards.
-
AuthorPosts
-
August 7, 2018 at 5:48 am #1591767
Linards
ParticipantIs it possible to add a custom link or content somewhere inside the Events calendar (not a PRO version) page container? Maybe a hook to add a link/extra button below calendar container?
Thanks
August 8, 2018 at 10:26 am #1593155Sky
KeymasterHi there,
Thanks for reaching out. I’d be happy to help with your question.
It is indeed possible to add content within the calendar output. All of our plugins use a templating system that makes it easy to customize specific views. To create a custom template, you simply copy the original template file from the plugin into your child theme in a “tribe-events” folder, and the custom template will be used in place of the original.
You can find out more information about this process here: https://theeventscalendar.com/knowledgebase/themers-guide/
We also use WordPress hooks and filters extensively throughout the templates, so it may also be possible to add content from your functions.php file.
If you can provide a detailed description and/or a screenshot of where you would like to add your custom content, I will help you figure out which template or hook you need to accomplish it.
Thanks,
SkyAugust 8, 2018 at 12:57 pm #1593315Linards
ParticipantThanks for the reply Sky,
I would like to hook a custom html link just below ul.tribe-events-sub-nav – the previous-next links. I just need a function to hook the content there and I will style all the CSS myself.
Regards
August 9, 2018 at 8:02 am #1593844Sky
KeymasterHi again,
That element is used on multiple templates, sometimes more than once on the page. Could you be more specific? Are you wanting to add content to the main calendar page or the single event page? If the main calendar page, which view(s) do you want the content to show on? ie, “month” “list” etc.
Thanks,
SkyAugust 9, 2018 at 8:10 am #1593851Linards
ParticipantHi,
I would like it on all pages where they are displayed. Below the yellow line on the screenshot. https://imgur.com/YkPtTXN
Regards
August 9, 2018 at 8:13 am #1593853Linards
ParticipantPreferably on month day and list pages.
August 10, 2018 at 9:22 am #1594791Sky
KeymasterHi again,
Thanks for the additional information.
To output content in that spot on all the main calendar pages, you could use one of the existing action hooks.
Here is an example to get you started:
add_action('tribe_events_after_header', 'my_custom_content', 100);
function my_custom_content() {
echo "Here is my custom content!";
}
Just add that code to your theme/child-theme’s functions.php file and replace the content with what you need.
Hope that helps! Please let me know if you have additional questions about this.
Thanks,
SkyAugust 11, 2018 at 9:30 am #1595361Linards
ParticipantThanks Sky! This helped me a lot!
August 13, 2018 at 7:26 am #1596069Sky
KeymasterHello,
Great! Glad I could help. Please let me know if you have any additional questions about this.
Thanks,
SkySeptember 4, 2018 at 9:35 am #1613182Support 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 ‘A hook to add custom link in events calendar page’ is closed to new replies.
