<?php 
get_header(); 
require EX_THEMES_DIR.'/libs/inc.news.php';

global $wpdb, $post, $opt_themes;
$defaults_no_images	= $opt_themes['ex_themes_defaults_no_images_']['url']; 
$image_id			= get_post_thumbnail_id($post->ID);  
$full				= 'thumbnails-news-bg';  
$image_url			= wp_get_attachment_image_src($image_id, $full, true); 
$image_url_news_post	= $image_url[0];
?>

<div id="content" class="site-content post-id-<?php the_ID(); ?>">
 
 
	 
	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<div class="container">
	
	<?php 
	do_action('bread_crums_blog');
	sp_single_row();
	sp_main();
	sp_article();
	?> 
	<h1 class="h5 font-weight-semibold text-truncate mt-3 mb-3"><?php the_title(); ?></h1>
	<div class="small font-weight-medium text-muted mb-3">
	<em><?php _e('by', TEXT_DOMAIN); ?> <?php echo $display_name; ?>, <?php echo get_the_time('l, j F Y ')?> (<?php the_time(); ?>) <?php echo edit_post_link( __( 'edit post', TEXT_DOMAIN ), ' ', ' ' ); ?>  </em>
	</div>
	<div class="zmImg text-center mb-3">
	<img width="100%" height="100%" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } else { echo $opt_themes['no_img']['url']; } ?>" class="rounded-lg shadow-sm mx-auto d-block" alt="<?php echo get_the_title(); ?>" loading="lazy" width="1024" height="500" style="max-height: 300px;" />
	</div> 	
	<?php
	break; 	
	case 'modyolo':
	?>
	<div class="container">
	
	<?php 
	do_action('bread_crums_blog');
	sp_single_row();
	sp_main();
	sp_article();
	?> 
	<h1 class="h5 font-weight-semibold text-truncate mt-3 mb-3"><?php the_title(); ?></h1>
	<div class="small font-weight-medium text-muted mb-3">
	<em><?php _e('by', TEXT_DOMAIN); ?> <?php echo $display_name; ?>, <?php echo get_the_time('l, j F Y ')?> (<?php the_time(); ?>) <?php echo edit_post_link( __( 'edit post', TEXT_DOMAIN ), ' ', ' ' ); ?>  </em>
	</div>
	<div class="zmImg text-center mb-3">
	<img width="100%" height="100%" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } else { echo $opt_themes['no_img']['url']; } ?>" class="rounded-lg shadow-sm mx-auto d-block" alt="<?php echo get_the_title(); ?>" loading="lazy" width="1024" height="500" style="max-height: 300px;" />
	</div> 	
	<?php
	break; 	
	case 'reborn':
	?>
	<div class="container">
	
	<?php 
	do_action('bread_crums_blog');
	sp_single_row();
	sp_main();
	sp_article();
	?> 
	<h1 class="h5 font-weight-semibold text-truncate mt-3 mb-3"><?php the_title(); ?></h1>
	<div class="small font-weight-medium text-muted mb-3">
	<em><?php _e('by', TEXT_DOMAIN); ?> <?php echo $display_name; ?>, <?php echo get_the_time('l, j F Y ')?> (<?php the_time(); ?>) <?php echo edit_post_link( __( 'edit post', TEXT_DOMAIN ), ' ', ' ' ); ?>  </em>
	</div>
	<div class="zmImg text-center mb-3">
	<img width="100%" height="100%" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } else { echo $opt_themes['no_img']['url']; } ?>" class="rounded-lg shadow-sm mx-auto d-block" alt="<?php echo get_the_title(); ?>" loading="lazy" width="1024" height="500" style="max-height: 300px;" />
	</div> 	
	<?php
	break; 	
	case 'liteapks':
	?>
	
	 
	<div class="py-2">
	<div class="container">
 
	<?php 
	do_action('bread_crums_blog');
	?>
	 
	</div>
	</div>
	<div class="container pt-4">
	<div class="row">
	<main id="primary" class="col-12 col-lg-9 content-area">
	<article class="bg-white border rounded shadow-sm p-3 mb-4">
	<h1 class="h2 font-weight-bold"><?php the_title(); ?></h1>
	<div class="small text-muted mb-4">
	<?php echo get_the_time('l, j F Y ')?> (<?php the_time(); ?>) <?php echo edit_post_link( __( 'edit post', TEXT_DOMAIN ), ' ', ' ' ); ?>
	</div>
	<div class="text-center mb-3">
	<img width="1280" height="720" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } else { echo $opt_themes['no_img']['url']; } ?>" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="<?php the_title(); ?>" >
	</div>
	<?php	
	break; 
	default:
	?>
	<div class="container">
	
	<?php 
	do_action('bread_crums_blog');
	sp_single_row();
	sp_main();
	sp_article();
	?> 
	<h1 class="h5 font-weight-semibold text-truncate mt-3 mb-3"><?php the_title(); ?></h1>
	<div class="small font-weight-medium text-muted mb-3">
	<em><?php _e('by', TEXT_DOMAIN); ?> <?php echo $display_name; ?>, <?php echo get_the_time('l, j F Y ')?> (<?php the_time(); ?>) <?php echo edit_post_link( __( 'edit post', TEXT_DOMAIN ), ' ', ' ' ); ?>  </em>
	</div>
	<div class="zmImg text-center mb-3">
	<img width="100%" height="100%" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } else { echo $opt_themes['no_img']['url']; } ?>" class="rounded-lg shadow-sm mx-auto d-block" alt="<?php echo get_the_title(); ?>" loading="lazy" width="1024" height="500" style="max-height: 300px;" />
	</div> 	
	<?php
	break; 
	}
	?>
	 
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	
	<?php  
	global $wpdb, $post, $wp_query, $opt_themes;
	$review_title		= get_post_meta( $post->ID, 'review_title', true );
	$review_images		= get_post_meta( $post->ID, 'review_images_url', true );
	$review_links		= get_post_meta( $post->ID, 'review_links', true );
	$review_name_links		= get_post_meta( $post->ID, 'review_name_links', true );
	$review_desc		= get_post_meta( $post->ID, 'review_desc', true );
	$review_rating		= get_post_meta( $post->ID, 'review_rating', true );
	$total_views		= ex_themes_get_post_view_(); 
	$total_views_alts		= ex_themes_get_post_view_alts(); 
	
	$rate_GP		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	$ratings_GP		= get_post_meta( $post->ID, 'wp_ratings_GP', true );
	$rate_GP1		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	if(get_post_meta($post->ID, 'review-app-on', true) == 'yes') { 
	?>
	<div class="review_app_box">
	<img src="<?php echo $review_images; ?>" class="icon " alt="<?php echo $review_title; ?>" data-was-processed="true">
	<div class="text">
	<a href="<?php echo $review_links; ?>" class="title "><?php echo $review_title; ?></a>
	<p><?php echo $review_desc; ?></p>
	<div class="other"> 		
	<div class="Stars" style="--rating:<?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?>;" aria-label="Rating of this product is <?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?> out of 5">
	<div class="rmp-results-widget__avg-rating" style="font-size: 13px;"><?php echo $review_rating; ?></div>
	<div class="rmp-results-widget__vote-count" style="font-size: 12px;">(<?php echo $total_views_alts; ?>)</div>
	</div>
	</div>
	</div>
	<a href="<?php echo $review_links; ?>" class="button"><?php echo $review_name_links; ?></a>
	</div>
	<?php } ?>
	<?php
	break; 	
	case 'modyolo':
	?>
	
	<?php  
	global $wpdb, $post, $wp_query, $opt_themes;
	$review_title		= get_post_meta( $post->ID, 'review_title', true );
	$review_images		= get_post_meta( $post->ID, 'review_images_url', true );
	$review_links		= get_post_meta( $post->ID, 'review_links', true );
	$review_name_links		= get_post_meta( $post->ID, 'review_name_links', true );
	$review_desc		= get_post_meta( $post->ID, 'review_desc', true );
	$review_rating		= get_post_meta( $post->ID, 'review_rating', true );
	$total_views		= ex_themes_get_post_view_(); 
	$total_views_alts		= ex_themes_get_post_view_alts(); 
	
	$rate_GP		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	$ratings_GP		= get_post_meta( $post->ID, 'wp_ratings_GP', true );
	$rate_GP1		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	if(get_post_meta($post->ID, 'review-app-on', true) == 'yes') { 
	?>
	<div class="review_app_box">
	<img src="<?php echo $review_images; ?>" class="icon " alt="<?php echo $review_title; ?>" data-was-processed="true">
	<div class="text">
	<a href="<?php echo $review_links; ?>" class="title "><?php echo $review_title; ?></a>
	<p><?php echo $review_desc; ?></p>
	<div class="other"> 		
	<div class="Stars" style="--rating:<?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?>;" aria-label="Rating of this product is <?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?> out of 5">
	<div class="rmp-results-widget__avg-rating" style="font-size: 13px;"><?php echo $review_rating; ?></div>
	<div class="rmp-results-widget__vote-count" style="font-size: 12px;">(<?php echo $total_views_alts; ?>)</div>
	</div>
	</div>
	</div>
	<a href="<?php echo $review_links; ?>" class="button"><?php echo $review_name_links; ?></a>
	</div>
	<?php } ?>
	<?php
	break; 	
	case 'reborn':
	?>
	
	<?php  
	global $wpdb, $post, $wp_query, $opt_themes;
	$review_title		= get_post_meta( $post->ID, 'review_title', true );
	$review_images		= get_post_meta( $post->ID, 'review_images_url', true );
	$review_links		= get_post_meta( $post->ID, 'review_links', true );
	$review_name_links		= get_post_meta( $post->ID, 'review_name_links', true );
	$review_desc		= get_post_meta( $post->ID, 'review_desc', true );
	$review_rating		= get_post_meta( $post->ID, 'review_rating', true );
	$total_views		= ex_themes_get_post_view_(); 
	$total_views_alts		= ex_themes_get_post_view_alts(); 
	
	$rate_GP		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	$ratings_GP		= get_post_meta( $post->ID, 'wp_ratings_GP', true );
	$rate_GP1		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	if(get_post_meta($post->ID, 'review-app-on', true) == 'yes') { 
	?>
	<div class="review_app_box">
	<img src="<?php echo $review_images; ?>" class="icon " alt="<?php echo $review_title; ?>" data-was-processed="true">
	<div class="text">
	<a href="<?php echo $review_links; ?>" class="title "><?php echo $review_title; ?></a>
	<p><?php echo $review_desc; ?></p>
	<div class="other"> 		
	<div class="Stars" style="--rating:<?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?>;" aria-label="Rating of this product is <?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?> out of 5">
	<div class="rmp-results-widget__avg-rating" style="font-size: 13px;"><?php echo $review_rating; ?></div>
	<div class="rmp-results-widget__vote-count" style="font-size: 12px;">(<?php echo $total_views_alts; ?>)</div>
	</div>
	</div>
	</div>
	<a href="<?php echo $review_links; ?>" class="button"><?php echo $review_name_links; ?></a>
	</div>
	<?php } ?>
	<?php
	break; 	
	case 'liteapks':
	?>
	
	<?php	
	break; 
	default:
	?>
	
	<?php  
	global $wpdb, $post, $wp_query, $opt_themes;
	$review_title		= get_post_meta( $post->ID, 'review_title', true );
	$review_images		= get_post_meta( $post->ID, 'review_images_url', true );
	$review_links		= get_post_meta( $post->ID, 'review_links', true );
	$review_name_links		= get_post_meta( $post->ID, 'review_name_links', true );
	$review_desc		= get_post_meta( $post->ID, 'review_desc', true );
	$review_rating		= get_post_meta( $post->ID, 'review_rating', true );
	$total_views		= ex_themes_get_post_view_(); 
	$total_views_alts		= ex_themes_get_post_view_alts(); 
	
	$rate_GP		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	$ratings_GP		= get_post_meta( $post->ID, 'wp_ratings_GP', true );
	$rate_GP1		= get_post_meta( $post->ID, 'wp_rated_GP', true );
	if(get_post_meta($post->ID, 'review-app-on', true) == 'yes') { 
	?>
	<div class="review_app_box">
	<img src="<?php echo $review_images; ?>" class="icon " alt="<?php echo $review_title; ?>" data-was-processed="true">
	<div class="text">
	<a href="<?php echo $review_links; ?>" class="title "><?php echo $review_title; ?></a>
	<p><?php echo $review_desc; ?></p>
	<div class="other"> 		
	<div class="Stars" style="--rating:<?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?>;" aria-label="Rating of this product is <?php if($review_rating){ echo $review_rating; } else { ?>0<?php } ?> out of 5">
	<div class="rmp-results-widget__avg-rating" style="font-size: 13px;"><?php echo $review_rating; ?></div>
	<div class="rmp-results-widget__vote-count" style="font-size: 12px;">(<?php echo $total_views_alts; ?>)</div>
	</div>
	</div>
	</div>
	<a href="<?php echo $review_links; ?>" class="button"><?php echo $review_name_links; ?></a>
	</div>
	<?php } ?>
	<?php
	break; 
	}
	?>	  
	
	<div class="pb-3  entry-content" id='entry-content'>
	<?php if( have_posts() ) : while( have_posts() ) : the_post(); the_content(); endwhile; endif; ?>
	</div> 
	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<?php if(function_exists('kk_star_ratings')) : ?>
	<div class="text-center d-flex align-items-center justify-content-center py-3 mb-3">
	<?php echo kk_star_ratings(); ?>
	</div>
	<?php endif ?>
	<?php ex_themes_blog_shares_2(); ?>
	<?php if ( shortcode_exists( 'rns_reactions' ) ){ ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?> 
	<?php } ?>	
	
	<?php if (get_the_term_list( $post->ID, 'news_tags' )) { ?>
	<span class="tags-links pb-3">
	<?php
	$terms = wp_get_post_terms( $post->ID, 'news_tags');
	foreach ( $terms as $term ) {
	$term_link = get_term_link( $term );
	echo '<a href="'.$term_link.'"># '.$term->name.'</a>';
	}
	?>
	</span>
	<?php } ?>
	<?php 
	sp_close_article();
	do_action('komentar_post');
	?>
	
	<?php
	sp_close_main();
	?> 
	 
	<!--sidebar-->	
	<?php do_action('single_sidebar'); ?> 
	<!--sidebar-->
	
	<?php sp_close_single_row(); ?> 
	<?php
	break; 	
	case 'modyolo':
	?>
	<?php if(function_exists('kk_star_ratings')) : ?>
	<div class="text-center d-flex align-items-center justify-content-center py-3 mb-3">
	<?php echo kk_star_ratings(); ?>
	</div>
	<?php endif ?>
	<?php ex_themes_blog_shares_2(); ?>
	<?php if ( shortcode_exists( 'rns_reactions' ) ){ ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?> 
	<?php } ?>	
	
	<?php if (get_the_term_list( $post->ID, 'news_tags' )) { ?>
	<span class="tags-links pb-3">
	<?php
	$terms = wp_get_post_terms( $post->ID, 'news_tags');
	foreach ( $terms as $term ) {
	$term_link = get_term_link( $term );
	echo '<a href="'.$term_link.'"># '.$term->name.'</a>';
	}
	?>
	</span>
	<?php } ?>
	<?php 
	sp_close_article();
	do_action('komentar_post');
	?>
	
	<?php
	sp_close_main();
	?> 
	 
	<!--sidebar-->	
	<?php do_action('single_sidebar'); ?> 
	<!--sidebar-->
	
	<?php sp_close_single_row(); ?> 
	
	<?php
	break; 	
	case 'reborn':
	?>
	<?php if(function_exists('kk_star_ratings')) : ?>
	<div class="text-center d-flex align-items-center justify-content-center py-3 mb-3">
	<?php echo kk_star_ratings(); ?>
	</div>
	<?php endif ?>
	<?php ex_themes_blog_shares_2(); ?>
	<?php if ( shortcode_exists( 'rns_reactions' ) ){ ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?> 
	<?php } ?>	
	
	<?php if (get_the_term_list( $post->ID, 'news_tags' )) { ?>
	<span class="tags-links pb-3">
	<?php
	$terms = wp_get_post_terms( $post->ID, 'news_tags');
	foreach ( $terms as $term ) {
	$term_link = get_term_link( $term );
	echo '<a href="'.$term_link.'"># '.$term->name.'</a>';
	}
	?>
	</span>
	<?php } ?>
	<?php 
	sp_close_article();
	do_action('komentar_post');
	?>
	
	<?php
	sp_close_main();
	?> 
	 
	<!--sidebar-->	
	<?php do_action('single_sidebar'); ?> 
	<!--sidebar-->
	
	<?php sp_close_single_row(); ?> 
	
	<?php
	break; 	
	case 'liteapks':
	?>
	</article>
	<?php  
	do_action('komentar_post');
	sp_close_main();
	?> 
	<!--sidebar-->	
	<?php do_action('single_sidebar'); ?> 
	<!--sidebar-->
	
	<?php sp_close_single_row(); ?> 
	<?php	
	break; 
	default:
	?>
	<?php if(function_exists('kk_star_ratings')) : ?>
	<div class="text-center d-flex align-items-center justify-content-center py-3 mb-3">
	<?php echo kk_star_ratings(); ?>
	</div>
	<?php endif ?>
	<?php ex_themes_blog_shares_2(); ?>
	<?php if ( shortcode_exists( 'rns_reactions' ) ){ ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?> 
	<?php } ?>	
	
	<?php if (get_the_term_list( $post->ID, 'news_tags' )) { ?>
	<span class="tags-links pb-3">
	<?php
	$terms = wp_get_post_terms( $post->ID, 'news_tags');
	foreach ( $terms as $term ) {
	$term_link = get_term_link( $term );
	echo '<a href="'.$term_link.'"># '.$term->name.'</a>';
	}
	?>
	</span>
	<?php } ?>
	<?php 
	sp_close_article();
	do_action('komentar_post');
	?>
	
	<?php
	sp_close_main();
	?> 
	 
	<!--sidebar-->	
	<?php do_action('single_sidebar'); ?> 
	<!--sidebar-->
	
	<?php sp_close_single_row(); ?> 
	
	<?php
	break; 
	}
	?>
	</div>
</div>

<?php
get_footer();  