Posted: November 25, 2015 at 3:46 am
|
Hi, on this page – http://corp.capechamber.auric-consulting.com/events/, you can see the events all showing as happening on the 23rd of November, this is the dates the events were posted not the start date configured in Event Espresso. What’s wrong? |
Hi there, With Event Espresso you can have multiple ‘datetimes’ within an event, so the post date (which is what your theme is outputting on that archive listing) will always be the date the event was created. To fix this you’ll need to alter template used to output those details, is this a custom theme or one you have purchased? |
|
|
It’s a theme called Directory+. The theme author’s support is laughable. If you can let me know what to change I can probably sort it out. |
I would recommend creating a child theme rather the modifying the theme files directly. When which template file is being loaded on that page, you can use a plugin such as What The File to find this. Install the plugin, load the page whilst logged in and view the templates loaded within the admin bar. You’ll likely find it’s the archive.php file and it could be loading other template parts within that. Find which file is loading the post date and copy that into your child theme, then within a espresso_events post type check: if ( 'espresso_events' == get_post_type() ) { // Run code specifically for EE events } You’ll need to grab the datetimes for the event and use the next upcoming datetime. Here is an example of how to pull the next upcoming datetime for an event: https://gist.github.com/Pebblo/f4d151e4784c6aa67a3d So then within the correct sections you can use: //echo the day $datetime->e_start_date('d'); //echo the month $datetime->e_start_date('M'); //echo the year $datetime->e_start_date('Y'); Again you’ll want to wrap that in a espresso_events post type check to output those details for EE events, but the original details for other post types. |
|
|
Here’s what I don’t understand. This was working correctly until some point, not sure when. But this is the page auto-generated by Event Espresso as defined in the Event Listings URL. |
The post date of the event post has never been the actual event date as that is actually the datetime date. So I’m not sure how this worked previously if theme used the those details.
The output is not auto generated by Event Espresso, it is auto generated by your theme we just hook in and inject the event details to the content. The /events/ listing is an archive of the espresso events post type so your theme outputs the archive and EE hooks into ‘the_content’ and adds the event details to that. We do not hook in and output a date like it is displayed on your current page, that’s all your theme using the post date. Please let me know how you get on. |
|
|
Completely lost |
|
I’ve activated the plug and found that archive.php is loading, here are the contents… {block content} After that, no idea. |
|
I *think* parts/post-content is the file to change by the looks of things. |
Hi Auric, Looking at the above it does look like the /parts/post-content/ template file is the template you need to copy over and modify. However that file may also call other templates so it depends on the contents. Looking at the shortcode for the page you linked – http://take.ms/t5gWO I would search the theme for link-day/month/year and short-date classes to narrow down where that output is coming from. |
|
|
Here’s the bit of parts/page-content.php that relevant. <div class=”entry-thumbnail-desc”> {var $dateIcon = $post->date} {includePart parts/entry-date-format, dateIcon => $dateIcon, dateLinks => $dateLinks, dateShort => $dateShort} <div class=”entry-title”> {if $post->hasImage} </div> If I delete the three var lines the date disappears. How do I change it to show the event date? |
|
What does that mean? |
|
The code for the dates is in entry-date.php. That’s also in /parts. |
Can you send me a copy of the theme please, I need to view the code to see whats happening. You can email a copy to support[at]eventespresso.com although depending on the size you may need to host the file and send us a link to download if from that. |
|
|
**REMOVED – Tony **
|
|
I’m not a programmer, I do Microsoft infrastructure so this stuff is mumbo jumbo to me |
Your theme is using some kind of template engine, so that code above is not something I’m used to myself. I did manage to make this work locally and have a template you can use. Download this – http://take.ms/oGxkt Within your child theme, place that file within a /parts/ directory. So you’ll have /directory2-child/parts/entry-date-format.php The date will then pull the date from your next upcoming datetime. It checks if we are dealing with a espresso_events post type using:
Then if we are it outputs the same details, only using the events datetime, if not it outputs the same as it usually would. I need to note that whilst I have provided the above, we can not provide further support for this, the theme works differently than most. If you have further problems with this you may need to create a ticket with the theme developers so they can provide a ‘proper’ template for this. |
|
|
Tony, you’re a legend. It’s working as expected. The annoying thing is that now that I see the code you wrote I’m thinking ‘Oh, it was that easy, was it?’ But I will admit I was lost. Of course, internally I’m going to take all the credit :P. Many thanks, Graham |
Yep, all of the info was in this post it just needed to be put togeth in the right place. I’m glad it helped, have a great weekend 🙂 |
|
The support post ‘Event showing post date not start date’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.