Home › Forums › Calendar Products › Events Calendar PRO › Single day view grabs wrong date from multi-day event
- This topic has 6 replies, 3 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
July 8, 2012 at 5:10 pm #21718baynatureParticipant
We’re using ECP Pro 2.0.7 plus Community Events 1.0.1 on a soon-to-launch site at staging.baynature.org, running WordPress 3.4.1.
Here’s a page from our implementation: http://staging.baynature.org/events/2012-07-26/
We modified the calendar widget to allow users to click on a day and go to that day (the Ajax popups were nice but not manageable when we will have 10-20 events/day).As you can see on the above link, the single-day view is pulling the H4 date and the Window Title from the first event in the list, which happens to be a long-running training. So the URL date is 2012-07-26, so we’d expect to see an H4 of July 26, 2012, and a Window Title like “Events, July 26, 2012”.
Is there a way to edit list.php to make this happen?
Thanks and great plugin!
July 9, 2012 at 10:40 am #21748JonahParticipantHi Dan,
What you’ll need to do is override the titles being spit out in the page template and in the header in your theme. Then, conditionally set the titles with something like this: https://gist.github.com/aad337b8f0662d4df1b6 – you’ll of course need to modify this to use markup specific to your theme but that’s basically what you’ll need to do.
I hope that helps!
– Jonah
July 9, 2012 at 1:03 pm #21796baynatureParticipantHi Jonah,
Thanks. We’re still having trouble with this. The only date var I see referenced in the code snippet you sent is “eventDate”. Isn’t that going to feed from the start date of the first event on the page (which is a multi-day event starting in the past)? So won’t that duplicate the problem we’re already having?
We tried this:
query_vars[‘eventDate’])); ?>
but that displays Jan 1, 1970 (as shown here: http://staging.baynature.org/events/2012-07-31/).
In any case, what we’re trying to do is display the selected day as shown in the URL but the page title and WP date stamp are different. Then the only function that I see with the calendar is the start date. So if it’s a multi-day event then you view Saturday’s page but it displays Friday’s date because that’s when the event started.Maybe the solution is to grab the last element of the URL and pull that date in and format it in the page title and HTML?
July 9, 2012 at 7:13 pm #21842baynatureParticipantFYI,I came up with a hack that works for the title on the page for now anyway. Not too pretty, but the best I can do while my real coders work on bigger issues. Looks like this (note sure how to show code snippets here):
=2) ) {
echo date(‘F j, Y’, strtotime($maybeDate));
}
?>July 9, 2012 at 7:13 pm #21843baynatureParticipantOops, code snippet got chopped. Oh well. Suffice it to say we have it mostly working for now.
July 10, 2012 at 1:35 pm #21885JonahParticipantHi Dan,
Glad to hear you’ve got this working. So are you all set here?
– Jonah
July 7, 2015 at 6:25 am #977301Support 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 ‘Single day view grabs wrong date from multi-day event’ is closed to new replies.