Support

Home Forums Event Espresso Premium Target items in ee-event-datetimes-li for CSS

Target items in ee-event-datetimes-li for CSS

Posted: February 4, 2017 at 7:11 am


Jerry

February 4, 2017 at 7:11 am

I would like to be able to target individual components within the ee-event-datetimes-li class so as to be able to apply CSS. For example, this is what gets output to HTML for an event:

<strong>Week 2</strong>
<br>
<span class="dashicons dashicons-calendar"></span>
July&nbsp;3,&nbsp;2017 - July&nbsp;7,&nbsp;2017
<br>
<span class="dashicons dashicons-clock"></span>
9:00&nbsp;am - 12:00&nbsp;pm
<br>
 - No class on July 4

I’d like to be able to, for instance, target the time range for special CSS treatment. Any way to achieve that?

Thanks for your help!


Josh

  • Support Staff

February 7, 2017 at 12:30 pm

Hi there,

I answered a related question that you posted in this other topic:

https://eventespresso.com/topic/remove-hyphen-space-from-datetime-description-display/

The answer includes some information on how to override the espresso_list_of_event_dates() function. Once you have your custom function set up, you can wrap the items with span tags and give them classes. Then you’ll be able to target those items with CSS.
e.g.
$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );
can be changed to:

$html .= '<span class="dashicons dashicons-clock"></span><span 
class="ee-dtt-range">' . $datetime->time_range( $time_format ) . '</span>';

The support post ‘Target items in ee-event-datetimes-li for CSS’ 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