<?php

$alignment = get_theme_mod('constructionarc_blog_single_alignment', 'text-left');
// Security: Sanitize alignment value for use in HTML class
$alignment = sanitize_html_class( $alignment );

$single_post_top_elements = get_theme_mod('constructionarc_single_post_top_elements', array('title', 'post_meta', 'content'));

?>
<article id="post-<?php the_ID(); ?>" <?php post_class('singlearticle ' . esc_attr( $alignment ) ); ?>>
	<?php

		constructionarc_themes_post_format_media();

		foreach ($single_post_top_elements as $element) {

			$template_function_name = "constructionarc_themes_single_{$element}";

			$template_function_name();
		}

	?>
</article><!-- #post-<?php the_ID(); ?> -->