Home › Forums › Calendar Products › Events Calendar PRO › Get Today's event to display on homepage
- This topic has 9 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
August 28, 2013 at 1:49 pm #63477
scottcharlesworth
ParticipantI 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.August 29, 2013 at 7:22 am #63597Barry
MemberHi Scott: is this something where you could leverage the existing Events List widget (perhaps set to display just 1 event)?
August 29, 2013 at 7:29 am #63604scottcharlesworth
ParticipantIt is my understanding that widgets are for sidebars and this is not in the sidebar.
August 29, 2013 at 7:34 am #63607Barry
MemberIndeed, 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.
August 29, 2013 at 7:36 am #63608scottcharlesworth
ParticipantTo 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/TNC7qXV6August 29, 2013 at 7:44 am #63613Barry
MemberOK, 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.
August 29, 2013 at 7:54 am #63614scottcharlesworth
ParticipantThat 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.
August 29, 2013 at 8:19 am #63623scottcharlesworth
ParticipantActually 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/PCe4KwYzAugust 29, 2013 at 8:44 am #63625Barry
MemberGreat – thanks for reporting back with that 🙂 – and since it sounds like you’re all sorted here I’ll go ahead and close this thread.
July 7, 2015 at 6:27 am #980491Support 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 ‘Get Today's event to display on homepage’ is closed to new replies.
