I have a base file called base.php, which at the top of everything has this function
<?php if(is_page(198) || is_page(174)) :
$altColorClass = 'alt';
$altColor = '#3f4549';
else :
$altColorClass = '';
$altColor = '#c0ccc2';
endif
?>
And then load a header.php
get_template_part('templates/header');
Now, in my header.php file I have the following line
<section class="header--bar <?= $altColorClass ?>">
But it doesn't get the value of altColorClass. How can I pass the variable to it when using get_template_part?