Support

Home Forums Event Espresso Premium Categories and colors not displaying in my class details or overview

Categories and colors not displaying in my class details or overview

Posted: August 8, 2014 at 2:33 pm


aryon hopkins

August 8, 2014 at 2:33 pm

WordPress 3.9.2 // EE Version 3.1.36.5.P Business License // New install
http://lsa2.updatecontent.com

I have categorized all of my classes and set the color of the categories but the categories aren’t displaying. Colors aren’t apparent anywhere either.


aryon hopkins

August 8, 2014 at 3:16 pm

They will list under the category on a separate page though:
http://lsa2.updatecontent.com/life-domains/

Custom Post Type conflict at all? The category I set up there is diplaying:
http://lsa2.updatecontent.com/events/pilates/

But then clicking on the Health & Wellness category returns
“Sorry, no content matched your criteria.”
http://lsa2.updatecontent.com/category/health-wellness/


Lorenzo Orlando Caum

  • Support Staff

August 8, 2014 at 5:53 pm

Hi,

Those colors are used on the calendar page. Do you have a page with the calendar shortcode running?


Lorenzo


aryon hopkins

August 10, 2014 at 10:24 pm

I have it in my sidebar and its own page:
http://lsa2.updatecontent.com/calendar/

Here are the settings for the Health & Wellness Category used for the Pilates class on August 12th that isn’t using the color purple that I specified on the Categories page:
http://i.share.pho.to/808e406e_o.png


Dean

August 10, 2014 at 11:45 pm

Hi Aryon,

Did you set the “Enable CSS for Categories” in the Event Espresso > Calendar settings page?

Can you also double check that the event has had the category assigned to it please?


aryon hopkins

August 13, 2014 at 5:04 am

All is well and colors are displaying after setting “Enable CSS for Categories”.

I could still use feedback as to how to output/add this category to display on the event_list_display.php and event_post.php so that the color will match across the Calendar, [EVENT_ESPRESSO_CATEGORY] and Event Detail.

I would also like the categories to display on the Events Espresso Upcoming Events Widget.


aryon hopkins

August 13, 2014 at 5:59 am

(Let me know if I should open a separate ticket for this support request.)

I updated my version of event_list_display.php to include:

		<!--Attempt to add category --> 
		<p id="event_category-<?php echo $category_identifier ?>"><span class="section-title"><?php _e('Category:', 'event_espresso'); ?></span></p><?php echo event_category_display($category_identifier) ?>
 		
		<p id="event_category-<?php echo $event_category_id ?>"><span class="section-title"><?php _e('Category:', 'event_espresso'); ?></span></p> 

I also attempted to output the category on single-espresso_event.php by using code from other parts of the template or other templates:


              <p><?php echo $event_cat; ?></p>
                        <?php echo '<p id="events_category_name-' . $category_id . '" class="events_category_name">' . stripslashes_deep($category_name) . '</p>'; ?>

Looking for a standardized way to call the Category name as well as a passing the id to the div so the Category color I have defined gets passed as well.

THANKS!


Josh

  • Support Staff

August 18, 2014 at 2:34 pm

Hi Aryon,

The following will return a category name:

$category_name = espresso_event_category_data($event_id, TRUE);
return $category_name['category_name'];

You can also get the colors via the espresso_event_category_data() function if you pull those from the category_meta array.


aryon hopkins

August 19, 2014 at 6:04 pm

Unfortunately I will need additional instruction on where to add this specific code and how to accurately reference it.

Adding it just above the Paragraph didn’t work:

<!-- Second attempt to add category --> 
<?php $category_name = espresso_event_category_data($event_id, TRUE); return $category_name['category_name']; ?>
<p id="event_category-<?php echo $category_name ?>"><span class="section-title"><?php _e('Category:', 'event_espresso'); ?></span></p> 		

Knowing how to call this in the id would also be helpful:
You can also get the colors via the espresso_event_category_data() function if you pull those from the category_meta array.


Dean

August 20, 2014 at 1:48 am

Hi,

It depend on what you want to do with it. For example, you could simply add the category to the event “block” like so




To get the actual colour code you would need to unserialize the data:


Doing a var_dump() on the $category_name will tell you what’s available to use.


aryon hopkins

August 20, 2014 at 5:42 am

Excellent. This gives me access to everything that I need.
I’ve never used unserialize or var_dump but I understand how it works now. Thanks!

The support post ‘Categories and colors not displaying in my class details or overview’ 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