<?php
/**
 * The template used for displaying page content in page.php
 *
 * @package Maskitto Light
 */

$style1 = '';
$background_color = get_post_meta( get_the_ID(), 'wpcf-background-color', true );
$background_image = get_post_meta( get_the_ID(), 'wpcf-background-image', true );

if( $background_color ) {
    $style1.= "background-color: $background_color;";
}

if( $background_image ) {
    $style1.= "background-image: url($background_image);";
}
?>

<article id="page-<?php the_ID(); ?>" <?php post_class(); ?>>

<?php
	$content = get_the_content();
	$content = apply_filters('the_content', $content);

	preg_match('/div class="page-section"/s', $content, $matches);
?>

	<?php if( count($matches) > 0 ) { ?>
		<div class="entry-content">
			<?php the_content(); ?>
		</div>
	<?php } else { ?>
	<div class="page-section" style=";padding: 00px 0;">
		<div class="container">
			<div class="post-inner"><?php the_content(); ?></div>
		</div>
	</div>
	<?php } ?>

	<footer class="entry-footer" style="display:none;">
		<?php edit_post_link( __( 'Edit', 'maskitto-light' ), '<span class="edit-link">', '</span>' ); ?>
	</footer><!-- .entry-footer -->
</article><!-- #post-## -->