Home › Forums › Ticket Products › Event Tickets Plus › add anchor in single-event.php
- This topic has 7 replies, 4 voices, and was last updated 9 years, 2 months ago by
Sue.
-
AuthorPosts
-
February 2, 2017 at 11:49 am #1228440
Sue
ParticipantHi,
I would like to add an anchor tab, at the top of the single-events.php, to the tickets section at the bottom of the page. I am able to do this but need to put some code in to only show this anchor tab when Tickets actually exist. I Just need to figure out how to test if there are tickets and if there is show anchor tab.
My php is very basic so any help would be appriciated!
February 3, 2017 at 12:40 pm #1229137Barry
MemberNeat idea, Sue!
Too functions that may help you here:
- tribe_events_has_tickets() — let’s you check if the event does indeed have tickets
- tribe_events_count_available_tickets() — returns the number of tickets still available for sale
So there are a few options – but perhaps something like this may help:
if ( tribe_events_count_available_tickets() >= 1 ) { // Display link }February 4, 2017 at 1:54 am #1229368Sue
ParticipantThanks Barry!
I,ve managed to get that working! Really appriciate your help!
Any idea where this file can be found public/template-tags/general.php? Trying to add the year back into the date on the events pages for this year. Done quite a bit of research but not getting anywhere. One post I read said I could change it in this file using $format = ‘F j’; ???? But i think the file structure is depricated or changed since that version? Any ideas on how I could change the date to show the year?
Sue
February 4, 2017 at 8:21 am #1229415Barry
MemberHi Sue,
Is it the date format that shows in single event pages that you wish to change, or elsewhere?
Using this event as an example is your goal to change the text reading February 16 @ 1:00 pm – 3:00 pm?
February 5, 2017 at 2:36 am #1229651Sue
ParticipantHi Barry!
Yes, exactly! I would like the year to display. I need it to be changed in the details section too but I’m hoping that the code will work for both in the end!
Sue
February 6, 2017 at 6:53 am #1229947Barry
MemberOK – so the fastest and easiest way to modify the date formats is via the options provided in the Events → Settings → Display screen (look for a section entitled Date Format Settings).
For example, you could alter the Date Without Year setting to actually include the year, simply by copying what you see in the Date With Year field.
If you need an even greater degree of control you can use the tribe_events_event_schedule_details_inner hook, though this would be a little more advanced so I’d recommend using the above options if you can.
February 28, 2017 at 8:35 am #1246928Support 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 ‘add anchor in single-event.php’ is closed to new replies.
