I created a WordPress template and now I would like to use that template for several pages, however I would like to have different background color on some of the elements such as footer, header etc... which will depend on the parent.
So lets say I have PARENT A (green background) and PARENT B (white background) now when I will create child of PARENT A I would like it to have green background automatically. I know something similar could be done with posts using
<div class="post <?php
foreach((get_the_category()) as $cat) {
echo $cat->cat_name . ' ';
} ?>">
</div>
I need some advice what would be the best way to do that.