Home › Forums › Calendar Products › Events Calendar PRO › Customize display of events list widget
- This topic has 11 replies, 5 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
January 9, 2012 at 10:13 am #13033danMember
trying again. every time I post my discussion the site gives me an error. the post never shows up. when I try to repost it, it tells me it’s a duplicate.
Hi I am trying to accomplish something where I can display a list of upcoming events for the current day with some pagination links below it exactly like this image here which I believe is using this plugin:
Can someone point me in the right direction. Ive already created a template and edited it, but it is displaying the date for every event instead of grouping them together.
can I do this by just creating a loop and calling the custom post type for events?
January 9, 2012 at 3:23 pm #13043Anthony D’ArcoParticipantI was just wondering the same thing.
January 9, 2012 at 5:01 pm #13075RobMemberHey Dan. That’s an odd error; if you want to send me your credentials (rob at tri.be) and some steps to recreate I will give it a go. I haven’t been able to recreate it but if it’s a problem with the forum we definitely want to get it patched up.
Not sure how to do this (it’s going to require some customization), but I’ll get one of our devs to take a look and see if they can offer up any suggestions. I know that such functionality has been requested a few times so it’ll likely make it into the official code base at some point or another as well.
January 9, 2012 at 7:37 pm #13105JonahParticipantHey Dan, can you post some code samples and maybe a link where I can see what you’ve got (or even a screenshot) in place now?
Thanks,
JonahJanuary 9, 2012 at 9:17 pm #13107danMemberhi thanks here is the link
it’s below the headline post.
here is the code I’m using:
[code]
<li >
<?php
$space = false;
$output = '';
echo '’ . tribe_get_start_date( $post->ID, $start ) . ”;if($event->AllDay && $start) {
//echo ‘ (‘.__(‘All Day’,’tribe-events-calendar-pro’).’)’;
} else {
if ( $end && $event->EndDate != ”) {
echo ” . __(‘Ends’, ‘tribe-events-calendar-pro’) . ‘ ‘;
echo tribe_get_end_date($post->ID);
}
}
?>
<a href="">post_title ?></a>
[/code]
January 10, 2012 at 9:34 am #13122JonahParticipantHi Dan,
This is a pretty customized development request and while we won’t be able to offer an exact solution I’ve got an idea of how this could work.
1. Setup your query to only pull in today’s events – you can do this with WP_Query or tribe_get_events and pass in the start_date and end_date parameters to be today’s date. If you’re using WP_Query make sure to pass in ‘post_type=tribe_events’ to only query for the events post type.
2. I would setup numerous instances of this in different panels that are hidden and shown via jQuery in some way. Each panel would contain the same query but the start_date/end_date would be different.
3. Hard code in the “pagination” by linking to the separate panels via jQuery.
That should work but you’ll have to customize and figure out the particular scripts to get everything working.
I hope that helps,
JonahJanuary 10, 2012 at 8:26 pm #13166danMemberok great thanks that helps. I can just use wp_query and call what I want then and treat it as any other custom post type.
January 10, 2012 at 9:58 pm #13170danMemberHow do I pass the start_date and end_date into tribe_get_events? can you show an example of that? the basic tribe_get_events query needed to pull in events with today’s start date? the rest of it I can handle.
January 11, 2012 at 10:07 am #13188JonahParticipantHey Dan, you should be able to pass it like so:
'start_date'=>'1/9/2012',
'end_date'=>'1/9/2012'
January 11, 2012 at 11:25 pm #13251danMemberawesome, thanks again.
And I assume I can grab today’s date using php’s date() function, store it in a variable and then use that with start_date so it always grabs “today” ?
January 12, 2012 at 10:21 am #13277JonahParticipantHey Dan, yep you got it, just get todays date stored in a variable and use that. It should work.
July 2, 2015 at 5:00 pm #975076Support DroidKeymasterThis 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 ‘Customize display of events list widget’ is closed to new replies.