Home › Forums › Calendar Products › Events Calendar PRO › Is there a way to get the post ID of the event?
- This topic has 5 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
November 22, 2013 at 11:59 am #78243
parkwaypartners
Participanthi – I’m trying to wrangle a way to display the first date only of recurring events in the calendar view, and I think I could cobble something together with javascript if I could find a way to isolate the post ID of the recurring event. I see that it creates a class name of post-xxxx – is there a way I can call that class name up on it’s own?
Thanks!
ErinNovember 22, 2013 at 3:20 pm #78280parkwaypartners
ParticipantIf it helps, what I’m aiming to do here is to create a data attribute and fill it with that ID number.
November 25, 2013 at 2:15 pm #78486Barry
MemberHi Erin: in terms of loading the first (upcoming) date of an event in a recurring series you could probably do this quite simply with tribe_get_start_date() and explicitly pass in the post ID for the event.
In terms of grabbing the numeric portion of the post-xxxx class and using it to populate some other element/attribute I’m sure that’s possible whether server-side or by Javascript, but it’s the sort of customization we can’t unfortunately help too much with.
November 25, 2013 at 2:34 pm #78491parkwaypartners
ParticipantThanks Barry –
I was able to get the post ID thing figured out in javascript, and thanks to your suggestion I am able to get the start date for the recurring events, but not the end date – is there a reason why this would work: tribe_get_start_date( $post->ID, FALSE, ‘F j’ );
but this just returns the start date again? tribe_get_end_date( $post->ID, FALSE, ‘F j’ );
?How else might I be able to get the last date for that recurring event?
Thanks again for your help!
November 25, 2013 at 3:34 pm #78515Barry
Memberis there a reason why this would work: tribe_get_start_date( $post->ID, FALSE, ‘F j’ );
but this just returns the start date again? tribe_get_end_date( $post->ID, FALSE, ‘F j’ );So as things currently stand passing the post ID to those functions means you will get the start and end date of the first upcoming event in the series. For that reason, if each instance of the recurring event starts and ends on the same day, you will indeed get the same date back here.
One way of getting what you need would be to insert a snippet like this one, admittedly a little rough and ready but you can always tweak it to meet your needs.
July 7, 2015 at 6:30 am #982648Support 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 ‘Is there a way to get the post ID of the event?’ is closed to new replies.
