<?php get_header();
$data = \INVENTIVE\Includes\Classes\Common::instance()->data('single-service')->get(); 

$layout = $data->get( 'layout' );
$sidebar = $data->get( 'sidebar' );
if (is_active_sidebar( $sidebar )) {$layout = 'right';} else{$layout = 'full';}
$class = ( !$layout || $layout == 'full' ) ? 'col-lg-12 col-md-12 col-sm-12' : 'col-lg-8 col-md-12 col-sm-12';
?>

<!-- Page Title -->
<section class="page-title">
    <div class="bg-layer" style="background-image: url('<?php echo esc_url( $data->get( 'banner' ) ); ?>');"></div>
    <div class="auto-container">
        <div class="content-box">
            <h1><?php if( $data->get( 'title' ) ) echo wp_kses( $data->get( 'title' ), true ); else( the_title( ) ); ?></h1>
            <ul class="bread-crumb clearfix">
                <?php echo inventive_the_breadcrumb(); ?>
            </ul>
        </div>
    </div>
</section>
<!-- End Page Title -->

<?php while (have_posts()) : the_post(); 
?>

<!--
=====================================================
    Service Details
=====================================================
-->
<!-- service-details -->
<section class="service-details pt_100 pb_100">
    <div class="auto-container">
        <div class="row">
        	<?php if( $data->get( 'layout' ) == 'left' ): ?>
			<div class="col-lg-4 col-md-12 col-sm-12 sidebar-side">
            	<div class="service-sidebar">
                    <?php dynamic_sidebar( $sidebar ); ?>
                </div>
            </div>
			<?php endif; ?>          
            
            <div class="<?php echo esc_attr( $class ); ?> <?php if ( $data->get( 'layout' ) == 'left' ) echo 'left-sidebar'; elseif ( $data->get( 'layout' ) == 'right' ) echo 'right-sidebar'; ?> content-side">                
                <div class="service-details-content">                	
					<div class="content-one mb_20">
                        <blockquote><?php echo (get_post_meta( get_the_id(), 'top_description', true ));?></blockquote>
                        <?php if(has_post_thumbnail()){ ?>
                        <figure class="image-box mb_40">
                            <?php $service_detail_image = get_post_meta( get_the_id(), 'service_detail_image', true ); ?>
                            <img src="<?php echo wp_get_attachment_url($service_detail_image['id']);?>" alt="<?php esc_attr_e('Awesome Image', 'inventive'); ?>" />
                        </figure>
                        <?php } ?>                        
                    </div>
                    
                    <?php the_content(); ?>
                    
                </div>
            </div>
            
            <?php if( $data->get( 'layout' ) == 'right' ): ?>
			<div class="col-lg-4 col-md-12 col-sm-12 sidebar-side">
            	<div class="service-sidebar">
                    <?php dynamic_sidebar( $sidebar ); ?>
                </div>
            </div>
			<?php endif; ?>
            
        </div>
    </div>    
</section>
<!-- gallery-details end -->

<?php endwhile; ?>
<?php get_footer(); ?>