<section id="feature-section" class="features-area home-features">
    <div class="container">
        <div class="row mr-0">
            <div class="col-lg-6">
                <div class="fea-bx">
                    <div class="row mr-0">
                        <?php for($p=1; $p<3; $p++) { ?>
                        <?php if( get_theme_mod('feature'.$p,false)) { ?>
                        <?php $querycolumns = new WP_query('page_id='.get_theme_mod('feature'.$p,true)); ?>
                        <?php while( $querycolumns->have_posts() ) : $querycolumns->the_post(); 
                            $image = wp_get_attachment_image_src(get_post_thumbnail_id() , true); ?>
                        <?php 
                            if(has_post_thumbnail()){
                            $img = esc_url($image[0]);
                            }
                            if(empty($image)){
                            $img = get_template_directory_uri().'/assets/images/default.png';
                            }
                        ?>

                        <?php  
                            $icon = get_theme_mod('feature_icon'.$p,'fa fa-lightbulb-o');
                        ?>

                        <?php  
                            $featurebox1_title = get_theme_mod('featurebox1_title','High Performance');
                            $featurebox1_description = get_theme_mod('featurebox1_description','There are many variations of passages of Lorem Ipsum avail');
                            $featurebox2_title = get_theme_mod('featurebox2_title','No Hidden Issues');
                            $featurebox2_description = get_theme_mod('featurebox2_description','There are many variations of passages of Lorem Ipsum avail');

                       ?>
                        
                        <!-- Start Single feature -->
                        <div class="col-lg-6 col-md-6 col-sm-6 box-space">
                            <div class="fourbox box<?php echo esc_attr( $p ) ?> <?php if($p % 4 == 0) { echo "last_column"; } ?>">    
                                <div class="single-feature">
                                    <div class="row mr-0">
                                        <div class="col-md-2 pd-0">
                                            <div class="part-1">
                                                <div class="iconbox">
                                                    <i class="<?php echo $icon; ?>" aria-hidden="true"></i>
                                                </div> 
                                            </div>
                                        </div>
                                        <div class="col-md-10">
                                            <div class="part-2">
                                                <h3 ><?php the_title_attribute(); ?></h3>
                                                <p><?php echo wp_trim_words(get_the_content(), 15); ?></p>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                        <!-- / End Single feature -->

                        <?php endwhile;
                        wp_reset_postdata(); ?>
                    <?php } } ?>
                        <div class="clear"></div> 

                        
                    </div>
                    <div class="clear"></div> 
                </div>
            </div>
            <div class="col-lg-6 rhs-fbx">
                <div class="row">
                    <div class="col-md-6 col-sm-6">
                        <div class="fourbox2">    
                            <div class="fbx fbrd">
                                <div class="Riconx">
                                    <i class="fa fa-cube" ></i>
                                </div> 
                                <div class="Rcontenbx">
                                    <h2><?php echo $featurebox1_title; ?></h2>
                                    <p><?php echo $featurebox1_description; ?></p>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6 col-sm-6">
                        <div class="fourbox2">    
                            <div class="fbx ">
                                <div class="Riconx">
                                    <i class="fa fa-cube" ></i>
                                </div> 
                                <div class="Rcontenbx">
                                    <h2><?php echo $featurebox2_title; ?></h2>
                                    <p><?php echo $featurebox2_description; ?></p>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div> 
    </div>
</section>
