Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Passing ID to WP template Registration display / Page Template Conditionals | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Passing ID to WP template Registration display / Page Template Conditionals

Passing ID to WP template Registration display / Page Template Conditionals

Posted: February 5, 2014 at 4:31 pm

Viewing 3 reply threads


artsguild

February 5, 2014 at 4:31 pm

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&#039;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[&#039;category_identifier&#039;];
$eecatz = str_replace ( &quot; &quot;, &quot;&quot;, $eecatz ); //strip spaces out!

if($eecatz == &quot;music&quot;) { 
get_template_part(&#039;music&#039;,&#039;block&#039;);
}
</code>

Thanks for your help with this.


Josh

February 6, 2014 at 1:53 pm

Hi there,

There’s a global variable that you can use in your custom function:

global $this_event_id;
$event_id = $this_event_id;


artsguild

February 13, 2014 at 9:18 am

Thanks Josh, I’ll check that out.


Dean

  • Support Staff

February 14, 2014 at 3:50 am

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.

Event Espresso - Staging Server