Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <section id="main">
- <?php
- $position = '';
- $repeat = '';
- $bgatt = '';
- $background_img = '';
- $background_color = '';
- if( is_single() || is_page() ){
- $settings = meta::get_meta( $post -> ID , 'settings' );
- if( ( isset( $settings['post_bg'] ) && !empty( $settings['post_bg'] ) ) || ( isset( $settings['color'] ) && !empty( $settings['color'] ) ) ){
- if( isset( $settings['post_bg'] ) && !empty( $settings['post_bg'] ) ){
- $background_img = "background-image: url('" . $settings['post_bg'] . "');";
- }
- if( isset( $settings['color'] ) && !empty( $settings['color'] ) ){
- $background_color = "background-color: " . $settings['color'] . "; ";
- }
- if( isset( $settings['position'] ) && !empty( $settings['position'] ) ){
- $position = 'background-position: '. $settings['position'] . ';';
- }
- if( isset( $settings['repeat'] ) && !empty( $settings['repeat'] ) ){
- $repeat = 'background-repeat: '. $settings['repeat'] . ';';
- }
- if( isset( $settings['attachment'] ) && !empty( $settings['attachment'] ) ){
- $bgatt = 'background-attachment: '. $settings['attachment'] . ';';
- }
- }else{
- if(get_background_image() == ''){
- $background_img = '';
- }else{
- $background_img = get_background_image();
- }
- }
- }else{
- if(get_background_image() == '' ){
- $background_img = '';
- }else{
- $background_img = get_background_image();
- }
- }
- ?>
- <?php
- while( have_posts () ){
- the_post();
- $post_id = $post -> ID;
- $template = 'single';
- $size = 'tsingle_style';
- $s = image::asize( image::size( $post->ID , $template , $size ) );
- $zoom = false;
- if( options::logic( 'blog_post' , 'enb_featured' ) ){
- if ( has_post_thumbnail( $post -> ID ) && get_post_format( $post -> ID ) != 'video' ) {
- $src = image::thumbnail( $post -> ID , $template , $size );
- $src_ = image::thumbnail( $post -> ID , $template , 'full' );
- $caption = image::caption( $post -> ID );
- $zoom = true;
- }
- }
- ?>
- <div id="primary" >
- <div id="content" role="main">
- <?php
- get_ads('logo');
- ?>
- <?php
- if( get_post_format($post->ID)=="gallery" ){
- /* for gallery posts we will show a slidedhow if there are more than 1 images */
- ob_start();
- ob_clean();
- post::get_post_img_slideshow( $post -> ID, $size = 'tsingle_gallery', $background_color, $background_img , $position, $repeat, $bgatt );
- $single_slideshow = ob_get_clean();
- }
- if(isset($single_slideshow) && strlen($single_slideshow)){
- echo '<div class="header-collapser icon-top animated"></div>';
- ?> <div class="row">
- <div class="twelve columns">
- <h2 class="post-title" style="padding-top: 25px;">
- <?php
- the_title();
- ?>
- </h2>
- </div>
- </div><?php
- echo $single_slideshow;
- }else{ /*we show featured image only when */
- if( options::logic( 'blog_post' , 'enb_featured' ) ){
- if ( has_post_thumbnail( $post -> ID ) && get_post_format( $post -> ID ) != 'video' ) {
- $src = image::thumbnail( $post -> ID , $template , $size );
- $full_img_url = image::thumbnail( $post -> ID , $template , 'full' );
- $caption = image::caption( $post -> ID );
- ?>
- <div class="entry-header" style="<?php echo $background_color ; ?> <?php echo $background_img ; ?> <?php echo $position; ?> <?php echo $repeat; ?> <?php echo $bgatt; ?>">
- <div class="row">
- <div class="twelve columns">
- <h2 class="post-title" style="padding-top: 25px;">
- <?php
- the_title();
- ?>
- </h2>
- </div>
- </div>
- <div class="featimg">
- <?php
- echo '<img src="' . $src[0] . '" alt="' . $caption . '" >';
- ?>
- <?php if( options::logic( 'blog_post' , 'enb_lightbox' )){ ?>
- <div class="zoom-image">
- <a href="<?php echo $full_img_url[0]; ?>" rel="prettyPhoto" title=""> </a>
- </div>
- <?php } ?>
- <?php if (options::logic('styling', 'stripes')) { ?>
- <div class="stripes"> </div><!--Must put height equal to image-->
- <?php } ?>
- </div>
- </div>
- <?php
- }
- }
- }
- $paralax = post::get_paralax_settings($post);
- if(is_array($paralax)){
- $paralax_enb_class = 'has-paralax';
- $paralax_pattern = $paralax['pattern'];
- $paralax_image = $paralax['image'];
- $paralax_enb = true;
- }else{
- $paralax_enb_class = '';
- $paralax_enb = false;
- }
- ?>
- <div class="single-row-container <?php echo $paralax_enb_class; ?>">
- <?php if($paralax_enb){ ?>
- <div class="single-slide-effects">
- <div class="single-slide1 single-slide-<?php echo $paralax_pattern; ?>"></div>
- <div class="single-slide2 single-slide-<?php echo $paralax_image; ?>"></div>
- </div>
- <?php } ?>
- <div class="single-main">
- <div class="row">
- <nav class="hotkeys-meta">
- <span class="nav-previous"><?php previous_post_link( '%link' , __('', 'cosmotheme') ); ?></span>
- <span class="nav-next"><?php next_post_link( '%link' , __('', 'cosmotheme') ); ?></span>
- </nav>
- <?php if( options::logic( 'blog_post' , 'breadcrumbs' ) ){ ?>
- <div class="twelve columns breadcrumbs">
- <?php echo dimox_breadcrumbs();?>
- </div>
- <?php } ?>
- <?php layout::side( 'left' , $post_id , 'single'); ?>
- <div class="main-container <?php echo tools::primary_class( $post_id , 'single', $return_just_class = true ); ?>">
- <article id="post-<?php the_ID(); ?>" <?php post_class( 'post big-post single-post no_bg' , $post -> ID ); ?>>
- <div class="entry-content ">
- <div class="row">
- <?php
- if( meta::logic( $post , 'settings' , 'meta' ) ){
- post::meta( $post );
- $content_nr_columns = 'nine';
- }else{
- $content_nr_columns = 'twelve';
- }
- ?>
- <div class="<?php echo $content_nr_columns; ?> columns">
- <?php
- //-------------------------
- if( get_post_format( $post -> ID ) == 'video' ){
- $video_format = meta::get_meta( $post -> ID , 'format' );
- ?>
- <div class="embedded_videos">
- <?php
- $format=$video_format;
- if( isset( $format['video'] ) && !empty( $format['video'] ) && post::isValidURL( $format['video'] ) ){
- $vimeo_id = post::get_vimeo_video_id( $format['video'] );
- $youtube_id = post::get_youtube_video_id( $format['video'] );
- $video_type = '';
- if( $vimeo_id != '0' ){
- $video_type = 'vimeo';
- $video_id = $vimeo_id;
- }
- if( $youtube_id != '0' ){
- $video_type = 'youtube';
- $video_id = $youtube_id;
- }
- if( !empty( $video_type ) ){
- echo post::get_embeded_video( $video_id , $video_type );
- }
- }else if( isset( $video_format["feat_url"] ) && strlen($video_format["feat_url"])>1){
- $video_url=$video_format["feat_url"];
- if(post::get_youtube_video_id($video_url)!="0")
- {
- echo post::get_embeded_video(post::get_youtube_video_id($video_url),"youtube");
- }
- else if(post::get_vimeo_video_id($video_url)!="0")
- {
- echo post::get_embeded_video(post::get_vimeo_video_id($video_url),"vimeo");
- }
- }else if(isset( $video_format["feat_id"] ) && strlen($video_format["feat_id"])>1){
- echo do_shortcode('[video mp4="'.wp_get_attachment_url($video_format["feat_id"]).'" width="610" height="443"]');
- //echo post::get_local_video( urlencode(wp_get_attachment_url($video_format["feat_id"])));
- }
- ?>
- <?php
- if(isset($video_format['video_ids']) && !empty($video_format['video_ids'])){
- foreach($video_format["video_ids"] as $videoid)
- {
- if( isset( $video_format[ 'video_urls' ][ $videoid ] ) ){
- $video_url = $video_format[ 'video_urls' ][ $videoid ];
- if( post::get_youtube_video_id($video_url) != "0" ){
- echo post::get_embeded_video( post::get_youtube_video_id( $video_url ), "youtube" );
- }else if( post::get_vimeo_video_id( $video_url ) != "0" ){
- echo post::get_embeded_video( post::get_vimeo_video_id( $video_url ) , "vimeo" );
- }
- }
- else echo post::get_local_video( urlencode(wp_get_attachment_url($videoid)));
- }
- }
- ?>
- </div>
- <?php
- }
- //---------------------------
- if(get_post_format($post->ID)=="image")
- {
- $image_format = meta::get_meta( $post -> ID , 'format' );
- echo "<div class=\"attached-image-gallery\">";
- echo '<div class="row">';
- if(isset($image_format['images']) && is_array($image_format['images']))
- {
- foreach($image_format['images'] as $index=>$img_id)
- {
- $thumbnail= wp_get_attachment_image_src( $img_id, 'thumbnail');
- $full_image=wp_get_attachment_url($img_id);
- $url=$thumbnail[0];
- $width=$thumbnail[1];
- $height=$thumbnail[2];
- echo '<div class="three columns mobile-one">';
- echo "<div class=\"attached-image-gallery-elem\">";
- echo "<a title=\"\" rel=\"prettyPhoto[".get_the_ID()."]\" href=\"".$full_image."\">";
- if($height<150)
- {
- $vertical_align_style="style=\"margin-top:".((150-$height)/2)."px;\"";
- }
- else
- {
- $vertical_align_style="";
- }
- echo "<img alt=\"\" src=\"$url\" $vertical_align_style>";
- echo "</a>";
- echo "</div>";
- echo "</div>";
- }
- }
- echo "</div>";
- echo "</div>";
- }
- if( get_post_format( $post -> ID ) == 'audio' ){
- $audio = new AudioPlayer();
- echo $audio->processContent( post::get_audio_file( $post -> ID ) );
- }
- the_content();
- ?>
- <?php
- if( get_post_format( $post -> ID ) == 'link' ){
- echo post::get_attached_file( $post -> ID );
- }
- ?>
- <div class="clear"></div>
- <?php wp_link_pages(array('before' => '<div class="pagenumbers"><p>Pages:','after' => '</p></div> ', 'next_or_number' => 'number')); ?>
- <?php get_template_part('social-sharing'); ?>
- </div>
- </div>
- </div>
- </article>
- </div>
- <?php layout::side( 'right' , $post_id , 'single' ); ?>
- </div>
- </div>
- </div>
- <?php
- /* related posts */
- get_template_part( 'related-posts' );
- ?>
- <?php
- /* comments */
- if( comments_open() ){
- ?>
- <div class="single-row-container">
- <div class="row">
- <div class="cosmo-comments twelve columns">
- <?php
- if( options::logic( 'blog_post' , 'fb_comments' ) ){
- ?>
- <div id="comments">
- <div class="row">
- <h3 id="reply-title"><?php _e( 'Leave a reply' , 'cosmotheme' ); ?></h3>
- <div class="twelve columns">
- <p class="delimiter"> </p>
- <fb:comments href="<?php the_permalink(); ?>" num_posts="5" width="430" height="120" reverse="true"></fb:comments>
- </div>
- </div>
- </div>
- <?php
- }else{
- comments_template( '', true );
- }
- ?>
- </div> <!-- eof cosmo comments -->
- </div>
- </div>
- <?php
- }
- ?>
- </div>
- <?php
- get_ads('content');
- ?>
- </div>
- <?php
- }
- ?>
- </section>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement