WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. zeroczy
    Member
    Posted 1 year ago #

    Hi

    I have some events grouped in 3 categories.
    http://advanceszkolenia.pl/szkolenia-otwarte/

    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:
    http://advanceszkolenia.pl/szkolenia-otwarte/szkolenia-marketingowe/

    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 1 year ago #

    Hi,

    Yes. The code at the end of this page should help:
    http://wordpress.org/support/topic/plugin-events-manager-display-placeholders-content-in-template?replies=3

    Just change #_EVENTDATES to #CATEGORYNAME.

  3. zeroczy
    Member
    Posted 1 year 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
    NetWebLogic Support
    Posted 1 year ago #

    thanks for the updates.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic