Adding a categories name as css class to an event in list or photo view

Home Forums Calendar Products Events Calendar PRO Adding a categories name as css class to an event in list or photo view

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1193100
    Benjamin
    Participant

    Hi,
    …i’m trying to customize the list/and or photo view of the calender pro plugin. But i got a problem: I want to add custom styles to the list view depending on the category an event is posted in. My suggestion is: I need to know the event categories name and make it selectable as an css class f.e. to the title … but how do i get the name of an events category as a string?

    I tried this code…but

    <?php
    echo tribe_get_event_categories(get_the_id(), array(
    'before' => '',
    'sep' => ', ',
    'after' => '',
    'label' => null, // An appropriate plural/singular label will be provided
    'label_before' => '',
    'label_after' => '',
    'wrap_before' => '',
    'wrap_after' => '',
    )
    );
    ?>

    ..i’m getting the label and the link and so on…

    Can anyone give me a hint? Where do i have to look?! Which code do i have to use?!

    Regards Beni

    #1193109
    Benjamin
    Participant

    Upsss! I just found out it’s already been done automatically….

    "tribe-events-category-myeventscategoriename"

    #1193418
    Josh
    Participant

    Hey Benjamin,

    Yep! We’ve got those added in there automatically for you.

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Adding a categories name as css class to an event in list or photo view’ is closed to new replies.