I scraped this code off the forum for category conditionals.
I like this since I’d like to show more information related to a certain category. ‘Music’ category is my example, which works in the registration_display file.
I’d like to use this (code below) in the sidebar of my page template, which holds the [ESPRESSO_EVENTS] short code.
How do I pass the event ID to this code outside registration_display template?
<code>
$ee=$event_id; // I'd like to pass the id
$eecat = espresso_event_category_data($event_id, $all_cats = TRUE); // use false if you dont want just one.
$eecatz = $eecat['category_identifier'];
$eecatz = str_replace ( " ", "", $eecatz ); //strip spaces out!
if($eecatz == "music") {
get_template_part('music','block');
}
</code>
Please let us know if you have any further questions regarding this.
Viewing 3 reply threads
The support post ‘Passing ID to WP template Registration display / Page Template Conditionals’ 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.