You declared the same function name, that's the cause of the "declared error". Just change the class function (including in the filter hook). Or you can just extend your function code. I also would rewrite the if structure to have a more easy readibility:
add_filter( 'nav_menu_css_class', 'add_custom_class', 10, 2 );
function add_custom_class( $classes = array(), $menu_item = false ) {
//Check if already have the class
if (! in_array( 'current-menu-item', $classes ) ) {
//Check if it's the ID we're looking for
if ( 1633 == $menu_item->ID ) {
//Check if is in a single post
if ( is_single() ) {
//Check if the single post is in the category
if ( in_category( 'Services' ) ) {
$classes[] = 'current-menu-item';
}
}
} elseif ( 1634 == $menu_item->ID ) {
//Check if is in a single post
if ( is_single() ) {
//Check if the single post is in the category
if ( in_category( 'Products' ) ) {
$classes[] = 'current-menu-item';
}
}
}
}
return $classes;
}
Besides that, this code is almost non-dynamic, since you must specify the menu ID and the category name. If I understood your menu logic, you're trying to add the 'current-menu-item' to a category menu, when a single post have that category. I would code something similar to: (so it would work with any category and post combination):
add_filter( 'nav_menu_css_class', 'add_custom_class', 10, 2 );
function add_custom_class( $classes = array(), $menu_item = false ) {
//Check if already have the class
if (! in_array( 'current-menu-item', $classes ) ) {
//Check if it's a category
if ( 'category' == $menu_item->object ) {
//Check if the post is in the category
if ( in_category( $menu_item->ID ) ) {
$classes[] = 'current-menu-item';
}
}
}
return $classes;
}