File: /home/retoti4c1e1s/www/thecommitment.earth/wp-content/themes/ananke/single.php
<?php
global $theme_option;
$image_header = '';
if ( function_exists( 'rwmb_meta' ) ) {
$images = rwmb_meta('_cmb_blog_image', "type=image");
foreach ( $images as $image ) {
$image_header = $image['full_url'];
break;
}
}
get_header();
?>
<section class="blog" id="blog">
<div class="parallax-section">
<div class="parallax-blog" <?php if($image_header != ''){ ?> style="background-image: url('<?php echo esc_url($image_header); ?>');" <?php } ?> ></div>
<div class="overlay-blog"></div>
<div class="container z-index-pages">
<div class="twelve columns">
<h1><?php echo esc_attr($theme_option['blog_title']); ?></h1>
</div>
<div class="twelve columns">
<div class="sub-text"><?php echo esc_attr($theme_option['blog_subtitle']); ?></div>
</div>
</div>
</div>
</section>
<section class="blog-post-wrapper">
<div class="container">
<?php if (isset($theme_option['blog_layout']) and $theme_option['blog_layout'] == 'wsbl') { ?>
<div class="four columns">
<?php get_sidebar();?>
</div>
<?php } ?>
<div class="<?php if(isset($theme_option['blog_layout']) and $theme_option['blog_layout'] != 'fw' ){echo 'eight';}else{echo 'twelve';}?> columns">
<?php while (have_posts()): the_post(); ?>
<?php $format = get_post_format($post->ID); ?>
<div class="blog-post" id="blog-single">
<?php if($format=='image'){?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="item">
<img alt="<?php the_title(); ?>" src="<?php echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));?>"/>
</div>
<?php }?>
<?php }elseif($format=='gallery'){ ?>
<?php if( function_exists( 'rwmb_meta' ) ) { ?>
<?php $images = rwmb_meta( '_cmb_images', array( 'size' => 'full' ) ); ?>
<?php if($images){ ?>
<div class="flexslider">
<ul class="slides">
<?php foreach ( $images as $image ) { ?>
<li><img src="<?php echo esc_url( $image['url'] ); ?>" alt="<?php echo esc_attr( $image['alt'] ); ?>" width="<?php echo esc_attr( $image['width'] ); ?>" height="<?php echo esc_attr( $image['height'] ); ?>"></li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php } ?>
<?php }elseif($format=='video'){?>
<?php $link_video = get_post_meta(get_the_ID(),'_cmb_link_video', true);?>
<?php if($link_video !=''){?>
<div class="item">
<div class="thevideo">
<iframe width="1100" height="550" src="<?php echo esc_url(get_post_meta(get_the_ID(),'_cmb_link_video', true));?>" ></iframe>
</div>
</div>
<?php }?>
<?php }elseif($format == 'audio'){?>
<?php $link_audio = get_post_meta(get_the_ID(),'_cmb_link_audio', true);?>
<?php if($link_audio !=''){?>
<div class="audio-player">
<iframe height="166" scrolling="no" frameborder="no" src="<?php echo esc_url(get_post_meta(get_the_ID(), "_cmb_link_audio", true));?>&color=ff5500&auto_play=false&hide_related=false&show_artwork=true"></iframe>
</div>
<?php }?>
<?php }else{?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="item">
<img alt="<?php the_title(); ?>" src="<?php echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));?>"/>
</div>
<?php } ?>
<?php }?>
<h3 class="single-title"><?php the_title(); ?></h3>
<div class="meta-data">
<ul>
<li><i class="fa fa-calendar-o" aria-hidden="true"></i> <a href="<?php the_permalink(); ?>"><?php the_date(get_option( 'date_format' )); ?></a></li>
<li><i class="fa fa-folder-open-o" aria-hidden="true"></i> <?php the_category( ', ' ); ?></li>
<li><i class="fa fa-comments-o" aria-hidden="true"></i> <?php comments_popup_link( __( 'No comments yet', 'ananke'), __( '1 comment', 'ananke'), __( '% comments', 'ananke'), 'comments-link', __( 'Comments are off for this post', 'ananke') ); ?></li>
</ul>
</div>
<?php the_content();?>
<?php wp_link_pages(); ?>
<?php
if(get_the_tag_list()) {
echo get_the_tag_list('<div class="tag11">','</div><div class="tag11">','</div>');
}
?>
<div class="post">
<?php echo get_avatar(get_the_author_meta('user_email'),$size='100',$default='http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=74' );?>
<h6><span><?php esc_html_e('Author:', 'ananke') ?> </span> <?php the_author_posts_link(); ?></h6>
<p><?php echo get_the_author_meta('description');?></p>
<div style="clear: both;"></div>
</div>
</div>
<?php if ( comments_open() || get_comments_number() ) : ?>
<?php comments_template();?>
<?php endif; ?>
<?php
// Previous/next post navigation.
the_post_navigation( array(
'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'ananke' ) . '</span> ' .
'<span class="post-title">%title</span>',
'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'ananke' ) . '</span> ' .
'<span class="post-title">%title</span>',
) );
?>
<?php endwhile; ?>
</div>
<?php if (isset($theme_option['blog_layout']) and $theme_option['blog_layout'] == 'wsb') { ?>
<div class="four columns">
<?php get_sidebar();?>
</div>
<?php } ?>
</div>
</section>
<?php get_footer(); ?>