File: /home/slyfwmm/studiomilighetti/wp-content/themes/domik/single.php
<?php
/* banner-php */
$sb_w = domik_get_option('blog-sidebar-width') ? domik_get_option('blog-sidebar-width') : 3;
get_header();
get_header('inner');
?>
<?php domik_inner_head_page_single(); ?>
<div class="domik_container domik-blog-single">
<?php while(have_posts()) : the_post(); ?>
<!-- post -->
<section>
<div class="row">
<?php if(domik_get_option('blog_layout')==='left_sidebar'):?>
<div class="col-md-<?php echo esc_attr($sb_w );?> post-sidebar-column sidebar-left">
<div class="blog-sidebar">
<?php get_sidebar( ); ?>
</div>
</div>
<?php endif;?>
<?php if(domik_get_option('blog_layout')==='fullwidth'):?>
<div class="col-md-12 nosidebar post-content-column">
<?php else:?>
<div class="col-md-<?php echo (12 - $sb_w);?> hassidebar post-content-column">
<?php endif;?>
<article <?php post_class('cth-single sinnle-post' );?>>
<?php if(!domik_get_option('blog_single_title')) : ?>
<h1 class="single-title"><?php single_post_title( ); ?></h1>
<?php endif; ?>
<?php if(domik_get_option('blog_date_single') || domik_get_option('blog_author_meta') || domik_get_option('blog_cats_single') || domik_get_option('blog_comments_single') || domik_get_option('blog_tags_single') ):?>
<ul class="blog-title">
<?php if(domik_get_option('blog_date_single')) :?>
<li><a class="tag" href="<?php echo get_day_link((int)get_the_time('Y' ), (int)get_the_time('m' ), (int)get_the_time('d' )); ?>"> <?php the_date(get_option('date_format' ));?></a></li>
<?php endif;?>
<?php if(domik_get_option('blog_author_meta')) :?>
<li> - </li>
<li><?php the_author_posts_link( );?></li>
<?php endif;?>
<?php if(domik_get_option('blog_cats_single')) :?>
<li> - </li>
<li><?php the_category(', ' );?></li>
<?php endif;?>
<?php if(domik_get_option('blog_tags_single')) :?>
<?php the_tags('<li> - </li><li>',', ','</li>');?>
<?php endif;?>
<?php if(domik_get_option('blog_comments_single')) :?>
<li> - </li>
<li><?php comments_popup_link(__('0 comment', 'domik'), __('1 comment', 'domik'), __('% comments', 'domik')); ?></li>
<?php endif;?>
</ul>
<?php endif;?>
<?php
if(domik_get_option('blog_featured_single')): ?>
<?php
// Get the list of files
$slider_images = get_post_meta( get_the_ID(), '_cmb_post_slider_images', true);
if( !empty($slider_images) ){
if( get_post_format( ) !== 'gallery' ): ?>
<div class="blog-media">
<div class="fullwidth-slider-holder">
<div class="customNavigation">
<a class="next-slide transition"><i class="fa fa-long-arrow-right"></i></a>
<a class="prev-slide transition"><i class="fa fa-long-arrow-left"></i></a>
</div>
<div class="fullwidth-slider owl-carousel owl-theme refreshowlonresize">
<?php
foreach ( (array) $slider_images as $img_id => $img_url ) {
echo '<div class="post-slider-item item">';
echo wp_get_attachment_image( $img_id, 'blog-thumb', false, array('class'=>'respimg') );
echo '</div>';
}
?>
</div>
</div>
</div>
<?php else: ?>
<div class="blog-media">
<div class="gallery-itemss <?php echo get_post_meta( get_the_ID() , '_cmb_gallery_cols', true );?>-coulms grid-small-pad popup-gallery">
<div class="grid-sizers"></div>
<?php
foreach ( (array) $slider_images as $img_id => $img_url ) {
?>
<div class="gallery-ites">
<div class="grid-item-holder">
<a href="<?php echo wp_get_attachment_url( $img_id );?>" class="blog-gal-href">
<?php echo wp_get_attachment_image( $img_id, 'blog-gallery', false, array('class'=>'respimg') ); ?>
</a>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php endif; ?>
<?php }elseif(get_post_meta(get_the_ID(), '_cmb_embed_video', true)!=""){
if(get_post_format( ) == 'audio') :
?>
<div class="blog-media">
<div class="resp-audio">
<?php
$audio_url = get_post_meta(get_the_ID(), '_cmb_embed_video', true);
if(preg_match('/(.mp3|.ogg|.wma|.m4a|.wav)$/i', $audio_url )){
$attr = array(
'src' => $audio_url,
'loop' => '',
'autoplay' => '',
'preload' => 'none'
);
echo wp_audio_shortcode( $attr );
}else{
echo wp_oembed_get($audio_url, array('height'=>'166') );
}
?>
</div>
</div>
<?php else : ?>
<div class="blog-media">
<div class="resp-video">
<?php echo wp_oembed_get(get_post_meta(get_the_ID(), '_cmb_embed_video', true)); ?>
</div>
</div>
<?php endif ; ?>
<?php }elseif(has_post_thumbnail( )){ ?>
<div class="blog-media">
<div class="box-item">
<?php the_post_thumbnail('full',array('class'=>'respimg') ); ?>
</div>
</div>
<?php } ?>
<?php endif;?>
<div class="blog-text">
<?php the_content();?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'domik' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div>
</article>
<?php if( domik_get_option('blog_author_single') && get_the_author_meta('description') !='' ) :?>
<div class="post-author">
<div class="post-author-wrap">
<div class="post-author-img">
<?php
echo get_avatar(get_the_author_meta('user_email'),$size='80',$default='http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=80' );
?>
</div>
<span><?php esc_html_e('Written By','domik' );?></span>
<h3><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php echo get_the_author_meta('nickname');?></a></h3>
<p><?php echo get_the_author_meta('description');?></p>
<?php if ( 'no' !== _x( 'yes', 'Show author socials on single post page: yes or no', 'domik' ) ) : ?>
<ul class="author-socials">
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_twitterurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Follow on Twitter','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_twitterurl' ,true)); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
<?php } ?>
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_facebookurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Like on Facebook','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_facebookurl' ,true)); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
<?php } ?>
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_googleplusurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Circle on Google Plus','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_googleplusurl' ,true)) ;?>" target="_blank"><i class="fa fa-google-plus"></i></a></li>
<?php } ?>
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_linkedinurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Be Friend on Linkedin','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_linkedinurl' ,true) ); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<?php } ?>
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_instagramurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Follow on Instagram','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_instagramurl' ,true) ); ?>" target="_blank"><i class="fa fa-instagram"></i></a></li>
<?php } ?>
<?php if(get_user_meta(get_the_author_meta('ID'), '_cmb_tumblrurl' ,true)!=''){ ?>
<li><a title="<?php esc_html_e('Follow on Tumblr','domik');?>" href="<?php echo esc_url(get_user_meta(get_the_author_meta('ID'), '_cmb_tumblrurl' ,true) ); ?>" target="_blank"><i class="fa fa-tumblr"></i></a></li>
<?php } ?>
</ul>
<?php endif; ?>
</div>
</div>
<?php endif;?>
<?php if(domik_get_option('blog_layout') !=='fullwidth'):?>
<!-- post end -->
<div class="content-nav nav-border-top">
<?php domik_post_nav();?>
<div class="p-all">
<a href="<?php echo esc_url( domik_get_option('blog_list_link') );?>" class="ajax"><i class="fa fa-th-large"></i></a>
</div>
</div>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif; ?>
<?php endif;?>
<?php endwhile;?>
</div>
<?php if(domik_get_option('blog_layout')==='right_sidebar'):?>
<div class="col-md-<?php echo esc_attr($sb_w );?> post-sidebar-column sidebar-right">
<div class="blog-sidebar">
<?php get_sidebar( ); ?>
</div>
</div>
<?php endif;?>
</div><!-- end .row -->
</section>
<?php if(domik_get_option('blog_layout') ==='fullwidth'):?>
<!-- post end -->
<div class="content-nav">
<?php domik_post_nav();?>
<?php if(domik_get_option('blog_list_link')) :?>
<div class="p-all">
<a href="<?php echo esc_url( domik_get_option('blog_list_link') );?>" class="ajax"><i class="fa fa-th-large"></i></a>
</div>
<?php endif;?>
</div>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif; ?>
<?php endif;?>
</div>
<?php
get_footer('inner');
get_footer();
?>