<?php
	$posts = get_posts_by_store_group($attrs['store_id'], 'site-banner');

	foreach ($posts as $post)  {
		$backgroundColor = '';
		$foregroundColor = '';

		if(isset($post)) {
			$content = apply_filters('the_content', $post->post_content);
			$content = str_replace(']]>', ']]&gt;', $content);

			$params = array('post_id' => $post->ID, 'raw' => true);
			$backgroundColor = types_render_field('background-color', $params);
			$foregroundColor = types_render_field('foreground-color', $params);

			if($backgroundColor) $backgroundColor = sprintf('style="background-color: %s;"', $backgroundColor);
			if($foregroundColor) $foregroundColor = sprintf('style="color: %s;"', $foregroundColor);
		}
?>

	<?php if(!empty($content)) { ?>

	<div class="page-banner" <?= $backgroundColor ?>>
		<div class="container"><h3 class="banner-title" <?= $foregroundColor ?>><?= $content ?></h3></div>
	</div>

	<?php } ?>
<?php } ?>