<?php

$page_title_style="";
if(get_theme_mod('advance_education_pro_page_title_content_option')=='Center'){
    $page_title_style='text-align:center;';
}else if(get_theme_mod('advance_education_pro_page_title_content_option')=='Left')
{
	$page_title_style='text-align:left;';
}else if(get_theme_mod('advance_education_pro_page_title_content_option')=='Right')
{
	$page_title_style='text-align:right;';
}else{
	$page_title_style='';
}
if ( ! is_singular() ) {
	return;
}
global $post;
$img = get_post_meta($post->ID, 'ts_title_banner_image_wp_custom_attachment', true);
$display = '';
$display_title_bbanner = '';
$ts_title_banner_image_title_on_off = get_post_meta($post->ID, 'ts_title_banner_image_title_on_off', true);
if($ts_title_banner_image_title_on_off == 'on') $display = 'style=display:none;';
$ts_title_banner_image_title_below_on_off = get_post_meta($post->ID, 'ts_title_banner_image_title_below_on_off', true);
if($ts_title_banner_image_title_below_on_off != 'on') $display_title_bbanner = 'style=display:none;';
if( $img != '' ){ ?>
	<div class="title-box">
		<div class="container" <?php echo esc_attr($display); ?>>
			<div class="above_title ">
				<h1 style="<?php echo esc_attr($page_title_style); ?>"><?php the_title(); ?></h1>
			</div>
		</div>
		<img src="<?php echo esc_url($img); ?>" >
	</div>
	<div class="container main_title" <?php echo esc_attr($display_title_bbanner); ?>>
		<h1 style="<?php echo esc_attr($page_title_style); ?>"><?php the_title();?></h1>
	</div>
<?php }else{ ?>
	<div class="container main_title">
		<h1 style="<?php echo esc_attr($page_title_style); ?>"><?php the_title();?></h1>
	</div>
<?php } ?>