Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter akinnc

    (@akinnc)

    I’ve been playing with this for over a week now and don’t know enough about filters to make this work the way I need it to. Can anyone help with the actual filter text I’d need to use? I have the following to add body classes based on the categories, but I’m not sure how to translate this over to the wpc_item_categories filter

    add_filter( 'body_class', 'add_body_class' );
    function add_body_class( $classes ) {
    if ( in_category( '365' ) && is_single())
    $classes[] = 'bus';
    elseif (in_category( '364') && is_single ())
    $classes[] = 'per';
    elseif (in_category( '363') && is_single ())
    $classes[] = 'mon';
    elseif (in_category( '362') && is_single ())
    $classes[] = 'fam';
    return $classes;
    }

    Thanks so much in advance!

Viewing 1 replies (of 1 total)