add anchor in single-event.php

Home Forums Ticket Products Event Tickets Plus add anchor in single-event.php

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1228440
    Sue
    Participant

    Hi,

    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!

    #1229137
    Barry
    Member

    Neat idea, Sue!

    Too functions that may help you here:

    So there are a few options – but perhaps something like this may help:

    if ( tribe_events_count_available_tickets() >= 1 ) {
        // Display link
    }
    #1229368
    Sue
    Participant

    Thanks 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

    #1229415
    Barry
    Member

    Hi 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?

    #1229651
    Sue
    Participant

    Hi 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

    #1229947
    Barry
    Member

    OK – 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.

    #1246928
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘add anchor in single-event.php’ is closed to new replies.