Events Manager
[resolved] Highlight event category link (4 posts)

  1. zeroczy
    Posted 2 years ago #


    I have some events grouped in 3 categories.

    Now i'd like to highlight left menu items.

    It's possible to put a category name in the permalink (and in a body class) and style specific item with CSS, for example here:

    But i can't do the same on the Event page.
    Is there any way to add CATEGORYNAME (or SLUG or other) in body class? Or is there any other way to connect event with its category in front side to style category links with CSS?

    thx for any help

  2. caimin_nwl
    NetWebLogic Support
    Posted 2 years ago #


    Yes. The code at the end of this page should help:

    Just change #_EVENTDATES to #CATEGORYNAME.

  3. zeroczy
    Posted 2 years ago #

    thank you caimin_nwl :)

    in my functions.php i added

    //EM event Body Class
    function add_EM_event_body_class( $classes ) {
    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');
    $classes[] = $EM_Event->output('#_CATEGORYSLUG');
    return $classes;
    add_filter( 'body_class', 'add_EM_event_body_class' );

    and that worked :)

  4. angelo_nwl
    NetWebLogic Support
    Posted 2 years ago #

    thanks for the updates.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic