How to create logged in and logged out menu for subsite?

Hi,

On the mainsite i use this code:

add_action('wp_enqueue_scripts', 'themezee_enqueue_scripts');

function my_wp_nav_menu_args( $args = '' ) {

if( is_user_logged_in() ) {
$args['menu'] = 'logged-in';
} else {
$args['menu'] = 'logged-out';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

to make a logged in and logged out menu bar. My question now is. Can i use this code somewhere in a subsite. So the subsite that i will use as a new blog template have also a logged in and logged out menu bar far all my future subsite makers.

Please advice?

Kind regards.

Kevin.