<?php 
/**
 * The template for displaying Home Page Seven(Blog Seven).
 * @package Sophi Blog
 */
$enabled_sections = sophi_blog_get_sections();
$homepage_design_layout     = sophi_blog_get_option( 'homepage_design_layout_options' );

if ($homepage_design_layout == 'home-seven'): ?>
    <?php
        if( is_array( $enabled_sections ) ) { 
            foreach( $enabled_sections as $section ) { ?>

                <?php if( $section['id'] == 'popular' ) { ?>
                    <?php $disable_popular_section = sophi_blog_get_option( 'disable_popular_section' );
                    $popular_lite_dark_bg = sophi_blog_get_option( 'popular_lite_dark_background' );
                    if( true ==$disable_popular_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section <?php echo esc_attr($popular_lite_dark_bg) ?>">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
            <?php } elseif( $section['id'] == 'catlist' ) { ?>
                <?php $disable_catlist_section = sophi_blog_get_option( 'disable_catlist_section' );
                    if( true ==$disable_catlist_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
                <?php } elseif( $section['id'] == 'editorpick' ) { ?>
                    <?php $disable_editorpick_section = sophi_blog_get_option( 'disable_editorpick_section' );
                    $editorpick_lite_dark_bg = sophi_blog_get_option( 'editorpick_lite_dark_background' );
                    if( true ==$disable_editorpick_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section <?php echo esc_attr($editorpick_lite_dark_bg) ?>">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
                <?php } elseif( $section['id'] == 'video' ) { ?>
                        <?php $disable_video_section = sophi_blog_get_option( 'disable_video_section' );
                        $video_lite_dark_background = sophi_blog_get_option( 'video_lite_dark_background' );
                        if( true ==$disable_video_section): ?>
                            <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section <?php echo esc_attr($video_lite_dark_background) ?>">
                                <div class="wrapper">
                                    <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                                </div>
                            </section> 
                    <?php endif; ?>
                <?php } elseif( $section['id'] == 'recent' ) { ?>
                    <?php $disable_recent_section = sophi_blog_get_option( 'disable_recent_section' ); 
                    $recent_lite_dark_background = sophi_blog_get_option( 'recent_lite_dark_background' );
                    if( true ==$disable_recent_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section <?php echo esc_attr($recent_lite_dark_background) ?>">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
                <?php } elseif( $section['id'] == 'message' ) { ?>
                    <?php $disable_message_section = sophi_blog_get_option( 'disable_message_section' );
                    if( true ==$disable_message_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
                <?php } elseif( $section['id'] == 'editorpick' ) { ?>
                    <?php $disable_editorpick_section = sophi_blog_get_option( 'disable_editorpick_section' );
                    if( true ==$disable_editorpick_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>
                <?php } elseif( $section['id'] == 'fixheight' ) { ?>
                    <?php $disable_fixheight_section = sophi_blog_get_option( 'disable_fixheight_section' );
                    $fixheight_lite_dark_background = sophi_blog_get_option( 'fixheight_lite_dark_background' );
                    if( true ==$disable_fixheight_section): ?>
                        <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section> 
                <?php endif; ?>    
                <?php } elseif( $section['id'] == 'mustread' ) { ?>
                    <?php $disable_mustread_section = sophi_blog_get_option( 'disable_mustread_section' );
                    if( true ==$disable_mustread_section): 
                         $background_contact_section = sophi_blog_get_option( 'background_contact_section' );?>
                        <section id="<?php echo esc_attr( $section['id'] );  ?>" class="relative page-section">
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        </section>
                <?php endif; ?> 
                <?php } ?>
            <?php } ?>
        <?php } ?>
<?php endif ?>