Can search results display the event date?

Home Forums Calendar Products Events Calendar PRO Can search results display the event date?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14675
    Jordan Polon
    Participant

    Is it possible to do or change something so that when events are returned in search results the event date is shown? Right now I have no date, or the date that the post was entered into the calendar. I’m okay with no date over the entry date, but ideally I’d love the event date to be part of what is returned to the user.

    Thanks.

    #14708
    Rob
    Member

    This may be possible, Tara – thanks for the question. It’s not doable out of the box but let me see if our dev Jonah has any suggestions as to how this could be doable. I’ll get him to respond here if so.

    #14732
    Jonah
    Participant

    Hi Tara,

    What you’ll need to do is modify your themes search results template. Typically this is the search.php file. You’ll need to conditionally check to see if the post in the results is an event which you can do with our template tag tribe_is_event() – and then display the event date with the tribe_get_start_date function – so for example:


    if(tribe_is_event()) {
    echo tribe_get_start_date( $post->ID, false, 'D. M j, Y' );
    }

    That should get you pointed in the right direction.

    #14746
    Jordan Polon
    Participant

    Thank you very much! I’ll try it now.

    #14768
    Rob
    Member

    Sounds good, Tara – let us know what you come up with and whether you have any other questions along these lines from there.

    #975563
    Support Droid
    Keymaster

    This 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Can search results display the event date?’ is closed to new replies.