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
Conditional statements based on event categories | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Conditional statements based on event categories

Conditional statements based on event categories

Posted: December 23, 2012 at 8:34 am

Viewing 2 reply threads


Post Creative

December 23, 2012 at 8:34 am

Hi I’d like to show different layouts in my template for different kind of events so I want to be able to do some if statments based on categories but also on meta tags too if possible. Here is an example of how I’m trying to only showing the register button for certain categories of events

<a href="http://dev.schoolforstartupscommunity.net/event-registration/?ee=">Register

 Is it just my inexperience with php or am I missing something important ? Nova
  • This topic was modified 12 years, 3 months ago by Post Creative. Reason: code didn't display properly
  • This topic was modified 12 years, 3 months ago by Post Creative.
  • This topic was modified 12 years, 3 months ago by Post Creative.


Post Creative

December 23, 2012 at 8:40 am

I’ve tried over and over again to post the code but I’m not having any luck – could you please give me an example of using event categories in this way or I could send the code by email.

thanks

Nova


Josh

December 24, 2012 at 9:26 am

Hi Nova,

A better way to post code is by using a service like pastebin or a github gist and link to the code here. That said, we do not typically help out with specific customizations. I can point you to some shortcodes and examples in the existing template code that may help.

The first example is the event category shortcode. If you wanted to have a different layout on the registration page depending on the category of the event, you could add the category shortcode to a div class like this:

<div class="<?php echo do_shortcode('[CATEGORY_NAME event_id="'.$event_id.'"]');?>">

<?php //template code here

</div>

Then you can target that div with CSS by specifying the class name/category name in the stylesheet.

Another example that can be used is the ee_meta, which can also be used to add specific hooks to the templates.

I do have one question about where you’re trying to only show the register for specific categories. Which template are you working with?

Viewing 2 reply threads

The support post ‘Conditional statements based on event categories’ 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