Get Today's event to display on homepage

Home Forums Calendar Products Events Calendar PRO Get Today's event to display on homepage

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #63477
    scottcharlesworth
    Participant

    I have looked around and can’t find anything that is helping me.
    I want to be able to display the next upcoming event for whatever day it happens to be on my homepage. If there isn’t a event for that particular day if finds the next event and displays it, then when that day passes it shows the next event, so on and so forth. I only want one event to show, even if there are multiple events for that same day. I have gotten close but nothing seems to be working. Seems like whatever I try displays the first event I ever entered in the calendar and not “the next” event.

    #63597
    Barry
    Member

    Hi Scott: is this something where you could leverage the existing Events List widget (perhaps set to display just 1 event)?

    #63604
    scottcharlesworth
    Participant

    It is my understanding that widgets are for sidebars and this is not in the sidebar.

    #63607
    Barry
    Member

    Indeed, but you could A) register and deploy a new sidebar for the homepage only, positioning it as you wish or B) use it outside of a sidebar thanks to WordPress’s nifty the_widget() function. It was just an idea for you to explore.

    #63608
    scottcharlesworth
    Participant

    To add to this. I want the next upcoming event to be displayed and only 1 upcoming event.

    Here is what I have so far.
    http://pastebin.com/TNC7qXV6

    #63613
    Barry
    Member

    OK, so that would basically seem to work for me – the only problem is that the dates will be wrong as your two calls to tribe_get_start_date() are outside of the loop and before setup_postdata() has been called.

    #63614
    scottcharlesworth
    Participant

    That is why I am asking for help, I don;t have a lot of PHP knowledge. I am still learning. Any help in getting this to work correctly will be greatly appreciated.

    #63623
    scottcharlesworth
    Participant

    Actually I got this working now. Your comment about how my dates were not in the loop helped. Duh!!!

    New code for anyone that might want to do this.
    http://pastebin.com/PCe4KwYz

    #63625
    Barry
    Member

    Great – thanks for reporting back with that 🙂 – and since it sounds like you’re all sorted here I’ll go ahead and close this thread.

    #980491
    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 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Get Today's event to display on homepage’ is closed to new replies.