<?php
$data = '';
global $post;
$sv_image_blog = get_post_meta(get_the_ID(), 'format_image', true);
if(!empty($sv_image_blog)){
    $data .=    '<div class="entry-photo">
                    <img alt="'.$post->post_name.'" title="'.$post->post_name.'" src="' . esc_url($sv_image_blog) . '"/>
                </div>';
}
else{
    if (has_post_thumbnail()) {
        $data .=    '<div class="entry-photo" style="display: none">
                        '.get_the_post_thumbnail(get_the_ID(),'full').'                
                    </div>';
    }
}
?>
<h2 class="page-title">
    <?php the_title()?>
    <?php echo (is_sticky()) ? '<i class="fa fa-thumb-tack"></i>':''?>
</h2>
<div class="page-content clearfix">
    <article class="entry-detail">
        <?php sv_display_metabox();?>
        <?php if(!empty($data)) echo balanceTags($data);?>
        <div class="entry-content clearfix">
            <?php the_content();?>
        </div>
        <div class="entry-tags">
            <span><i class="fa fa-tags" aria-hidden="true"></i> <?php esc_html_e("Tags:",'megastore');?></span>
            <?php $tags = get_the_tag_list(' ',', ',' ');?>
            <?php if($tags) echo balanceTags($tags); else esc_html_e("No Tag",'megastore');?>
        </div>
    </article>
</div>