I want to display the sales dates on each course when I call [Espresso Events]. I’ve activated the setting in the template settings but for me to see the sales dates I have to press show details in the ticket selector. Instead, I would like to not have the ticket selector visible and only show the sales date.
In addition, I want to change the ‘Goes on sale:’ and ‘sale Ends:’ text to ‘Registration Begins’ and ‘Registration Ends:’ respectively. Thank you in advance if this is possible.
I’ve activated the setting in the template settings but for me to see the sales dates I have to press show details in the ticket selector. Instead, I would like to not have the ticket selector visible and only show the sales date.
Currently, we don’t have an option for this, the ticket are pulled into the ticket selector and then the details for each individual ticket (as each of the tickets on your event could have different settings/dates) is shown in the additional section for each individual ticket.
You could use some custom code to pull this in an display it for each individual event but we don’t have any examples of this so you’ll need the help of a developer. If you are not currently working with one we recommend the folks at Codeable.
In addition, I want to change the ‘Goes on sale:’ and ‘sale Ends:’ text to ‘Registration Begins’ and ‘Registration Ends:’ respectively. Thank you in advance if this is possible.
This can be done, but those details are currently added to the ticket selector, which you mentioned you don’t want to use above, so does this still apply?
You could use some custom code to pull this in an display it for each individual event but we don’t have any examples of this so you’ll need the help of a developer.
I am trying to achieve this with some custom code, I was wondering if you would be able to guide me to the location of the code I need, I can’t seem to find it myself.
This can be done, but those details are currently added to the ticket selector, which you mentioned you don’t want to use above, so does this still apply?
No this longer applies, I will edit those when I find the code to put in, thanks!
I am trying to achieve this with some custom code, I was wondering if you would be able to guide me to the location of the code I need, I can’t seem to find it myself.
Ok, so are you loading any custom templates currently?
You’re using [ESPRESSO_EVENTS] which calls which loads it’s own template, have you customized that?
There’s not enough details to know what you can’t find so I don’t know where you are stuck. We don’t provide support for customizations but I can help point you in the right direction if you let me know where you are up to.
No this longer applies, I will edit those when I find the code to put in, thanks!
?? It sounds like your trying to edit core files and if that’s the case it’s not the correct way to do this.
—
The information you need can be pulled from the events using our model system:
You’re using [ESPRESSO_EVENTS] which calls which loads it’s own template, have you customized that?
I have been editing the file content-espresso_events-shortcode.php directly for editing the template. Is there a different way I should be going about making a custom template?
It’s not a good idea to edit any core files as they’ll be lost on each and every update.
Create a child theme (if you’re not using one already) and copy that template into the root directory of the child theme, then edit the template there. EE will use that in place of the original.
My previously reply explained exactly how you should do it.
Create a child theme (if you’re not using one already) and copy that template into the root directory of the child theme, then edit the template there. EE will use that in place of the original.
‘That template’ being content-espresso_events-shortcode.php
We (Event Espresso support) can’t provide support for other’s tutorials, I can point you in the right direction on how to pull various bits of information from EE/Events etc but walking through how to create a full grid template is outside the scope of support.
I did take a quick look at the code you posted and what you have looks fine to me so I don’t know why it’s not working for you.
If my code is correct then I’m not sure why it is not working either.
The tutorial setups all the divs under one parent div. My question is how are the events put in? since of course, I don’t code in every div for each event box. To clear things up I want the courses laid out in a two-column grid instead of one when I call the shortcode, so I am not certain if this is the right file to be working in anymore.
content-espresso_events-shortcode.php is calls from within loop-espresso_events.php, that is where you would need your parent div.
It’s starting to sound like you would be better just creating your own shortcode to output a template of your choosing as your now moving into templates that are used for other outputs so be careful on what you edit and test fully.
I am having a bit of trouble understanding the location of event espresso content. For example, I want to extract just the course description and just the “view details” button, where would I find this? Then I want to change view details text to say “register now”
The ‘view details’ button is part of the ticket selector, you can’t access just that button on it’s own although you can call the ticket selector.
Thing is, the templates you’ve edited already show you how to call all of these sections, so have you gonna through them to find this out? If so, what specifically are you stuck on?
I want to make the following edits:
– Remove the second instance of date times and address shown
– Move the view details button in between the description and Barcode custom field. You said the button is part of the ticket selector but I do not have the ticket selector on so I am not sure why it is appearing for me.
– Remove the ical button only for registration dates (if not possible then just remove it in general)
Below is the code in my content-event_espresso-shortcode.php :
<?php
/**
* This template will display a single event - copy it to your theme folder
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2013 Event Espresso All Rights Reserved.
* @ license https://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version 4+
*/
/*************************** IMPORTANT *************************
* if you are creating a custom template based on this file,
* and do not wish to use the template display order controls in the admin,
* then change the following filter to:
* add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' );
* comment out calls to the_content() and espresso_event_content_or_excerpt()
* then UN-comment and position the additional template parts
* that are loaded via the espresso_get_template_part() function to your liking
* and/or use any of the template tags functions found in:
* \wp-content\plugins\event-espresso-core\public\template_tags.php
************************** IMPORTANT **************************/
add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_false' );
//echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';
global $post;
$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class );
?>
<?php do_action( 'AHEE_event_details_before_post', $post ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>>
<?php if ( is_archive() ) : ?>
<div class="kgm-single-course-box">
<div class="kgm-course-title">
<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
</div>
<div class="kgm-course-details">
<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
<?php $keyvalue2 = get_post_meta( get_the_ID(), 'Ages', true );
// Check if the custom field has a value.
if ( ! empty( $keyvalue2 ) ) {
echo 'Ages: ' , $keyvalue2;
} ?>
</div>
<div id="espresso-event-thumbnail" class="kgm-course-thumbnail">
<?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
</div>
<div class="kgm-course-desc">
<?php the_content(); ?>
<?php $keyvalue = get_post_meta( get_the_ID(), 'Barcode', true );
// Check if the custom field has a value.
if ( ! empty( $keyvalue ) ) {
echo 'Barcode: ' , $keyvalue;
} ?>
</div>
</div>
<?php endif; ?>
</article>
<!-- #post -->
<?php do_action( 'AHEE_event_details_after_post', $post );
One thing I am wondering is what exactly does espresso_event_content_or_excerpt(); do?
It will either return the event content, or the except depending on if the current output is_single(), is_archive() and depending on your template settings (Event Espresso -> Events -> Templates).
Looks lie your site is still loading the auto injected details, have you followed the steps between the /*************************** IMPORTANT ************************* comment?
– Remove the ical button only for registration dates (if not possible then just remove it in general)
?? Sorry but I don’t understand what you are trying to do.
What do you mean by ‘only for registration dates’?
Below is the code in my content-event_espresso-shortcode.php
The forum isn’t really designed for large sections of code, please use something like pastebin and post the URL to it here for us to view.
have you followed the steps between the /*************************** IMPORTANT ************************* comment?
Yes I have, I accidentally pasted the older code prior to completing the steps.
?? Sorry but I don’t understand what you are trying to do.
What do you mean by ‘only for registration dates’?
If you take a look at what I have here: https://imgur.com/3n0QIRr I’d like the white ical button to only appear under the datetime labelled ‘Event Dates’ and remove it for any datetime labelled ‘Registration dates’ I’m not sure if this is supported in EE so if not I would just like to remove the ical button completely.
Lastly, I am looking through the template_tags.php file but cannot seem to find how to put in just the description of an event?
Apologies about the large section of code I will make sure to use pastebin if I ever need to post that much code again.
Yes I have, I accidentally pasted the older code prior to completing the steps.
So you have now changed the filter to return true?
If you take a look at what I have here: https://imgur.com/3n0QIRr I’d like the white ical button to only appear under the datetime labelled ‘Event Dates’ and remove it for any datetime labelled ‘Registration dates’ I’m not sure if this is supported in EE so if not I would just like to remove the ical button completely.
Oh, I see.
We don’t have the option to selectively load the ical but you can add this function to your site to remove them:
So you have now changed the filter to return true?
Yes, works now.
you can add this function to your site to remove them:
Thanks!
Without any filters? $event->description() will output the description.
What do you mean by filters? When I tried this I got a critical error, I assume I am using it incorrectly since I am new to PHP, I wrote <?php $event->description(); ?> is this incorrect?
Why can you not use espresso_event_content_or_excerpt()?
I want to set up my events in a specific layout and order that I couldn’t achieve with that. I have everything the way I want it but just want to display the description of an event within the ‘kgm-courses’desc’ div. https://pastebin.com/fH6h9vvU
I assumed you’d have pulled the EE_Event object
No, I did not do this, I don’t know what you mean by pull the event object. If I do this will I be able to use <?php $event->description(); ?> to just display the event description?
No, I did not do this, I don’t know what you mean by pull the event object. If I do this will I be able to use <?php $event->description(); ?> to just display the event description?
You’ll need to add echo to output the description to the page:
echo $event->description();
Viewing 25 reply threads
The support post ‘Show Sales 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.
Support forum for Event Espresso 3 and Event Espresso 4.