Home › Forums › Calendar Products › Events Calendar PRO › 'Next Event' shortcode
- This topic has 4 replies, 4 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
April 12, 2016 at 12:13 pm #1101538
showchinchillaz
ParticipantI’d like to use a shortcode to display a text link saying ‘Next event: ‘ or ‘Upcoming event’ or suchlike. It needs to be linear and without a calendar as the space is beside my logo in a header.
Is there a way to do this please?
Thanks!
April 12, 2016 at 9:03 pm #1101742Cliff
MemberHi Andrew. Thanks for your question.
These are our plugins’ widgets and shortcodes.
If the shortcode you’re wanting doesn’t exist there, you could create your own but this would be in the realm of personal customization.
However, I can point you to a function I think you might need to use for this: tribe_the_next_event_link()
Please let me know if you think I can be of further assistance.
April 14, 2016 at 9:59 am #1102571Harrison
ParticipantHi Cliff,
I’ve had a look at the resources you’ve provided and I’m trying to fathom how to use the tribe_the_next_event_link()
I’ve figured out how to use this to create a shortcode but is there a way to incorporate this into a HTML link?
Thanks
Harrison
P.S. you can create a shortcode for this by adding the following after the closed function on line 54 of src/functions/template-tags/link.php:
add_shortcode('your_shortcode_name', 'tribe_the_next_event_link');April 14, 2016 at 2:14 pm #1102733Cliff
MemberThis is the source code for that function: https://github.com/moderntribe/the-events-calendar/blob/4.1.1.1/src/functions/template-tags/link.php#L41
Which basically ends up running get_event_link(): https://github.com/moderntribe/the-events-calendar/blob/4.1.1.1/src/Tribe/Main.php#L4083
Which already outputs the
a hrefHTMLI hope this clears things up for you for however you’re wanting to use these functions for your customization. Maybe you should just use get_event_link() directly. I can’t know for sure without writing the code for you.
April 29, 2016 at 9:35 am #1108843Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘'Next Event' shortcode’ is closed to new replies.
