<?php

global $wpdb, $post, $opt_themes;
$background_on					= $opt_themes['ex_themes_backgrounds_activate_'];
$ukuran							= '=w1400-rw';
$random							= mt_rand(0, 2); 
$full							= 'thumbnails-post-bg'; 
$thumbnails_bg 					= wp_get_attachment_image_src(get_post_meta( $post->ID, 'background_images', true),$full);
$thumbnails_bg_alt				= get_post_meta( $post->ID, 'wp_backgrounds_GP', true ); 
$thumbnails_bg_alts				= get_post_meta( $post->ID, 'wp_images_GP', true );	
$title							= get_post_meta( $post->ID, 'wp_title_GP', true );
$title_alt						= get_the_title(); 
$text_edit_post					= $opt_themes['text_edit_post'];
if($background_on) { ?>		

<div class="rounded-lg mb-3 mb-md-4 position-relative">
<img class="rounded-lg d-block object-cover" style="<?php if($thumbnails_bg_alt || $thumbnails_bg_alts ) { ?>width: 100%;<?php } ?>min-height:200px; margin-left: auto;margin-right: auto;" src="<?php if(get_post_meta( get_the_ID(), 'background_images', true)){ echo wp_get_attachment_image_src(get_post_meta( get_the_ID(), 'background_images', true),'thumbnails-post-bg')[0]; } elseif(get_post_meta( get_the_ID(), 'wp_backgrounds_GP', true )){ echo get_post_meta( get_the_ID(), 'wp_backgrounds_GP', true ); } elseif(get_post_meta( get_the_ID(), 'wp_images_GP', true )){ echo get_post_meta( get_the_ID(), 'wp_images_GP', true )[mt_rand(0, 3)]; } else { echo $opt_themes['no_img']['url']; } ?>">
<div class="text-center text-white rounded-lg p-4 p-md-5 d-flex align-items-center justify-content-center position-absolute" style="background-color: rgba(0, 0, 0, 0.6); z-index: 10; top: 0; bottom: 0; left: 0; right: 0;">
<div>
<h1 class="h2 font-weight-bold">
<?php if($opt_themes['single_appname']){ echo get_post_meta( $post->ID, 'wp_title_GP', true); ?> <?php _e($opt_themes['text_18'], TEXT_DOMAIN); ?> <?php if(get_post_meta( $post->ID, 'wp_version_GP', true )){ echo get_post_meta( $post->ID, 'wp_version_GP', true ); } ?> <?php if(get_post_meta( $post->ID, 'wp_mods', true )){?>(<?php echo trim(strip_tags(ucwords(get_post_meta( $post->ID, 'wp_mods', true )))); ?>)<?php } } else { the_title(); } ?>
</h1>
<time class="d-block">
<svg class="svg-5 svg-white mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C201.7 512 151.2 495 109.7 466.1C95.2 455.1 91.64 436 101.8 421.5C111.9 407 131.8 403.5 146.3 413.6C177.4 435.3 215.2 448 256 448C362 448 448 362 448 256C448 149.1 362 64 256 64C202.1 64 155 85.46 120.2 120.2L151 151C166.1 166.1 155.4 192 134.1 192H24C10.75 192 0 181.3 0 168V57.94C0 36.56 25.85 25.85 40.97 40.97L74.98 74.98C121.3 28.69 185.3 0 255.1 0L256 0zM256 128C269.3 128 280 138.7 280 152V246.1L344.1 311C354.3 320.4 354.3 335.6 344.1 344.1C335.6 354.3 320.4 354.3 311 344.1L239 272.1C234.5 268.5 232 262.4 232 256V152C232 138.7 242.7 128 256 128V128z"></path></svg>
<em class="align-middle">
<?php the_modified_time('M d, Y'); ?> (<?php echo human_time_diff(get_the_modified_time('U'),current_time('U') ). ' ago '; ?>) <?php if( is_user_logged_in() || current_user_can('editor') || current_user_can('administrator') ) { echo edit_post_link( __( $text_edit_post, THEMES_NAMES ), ' ', ' ' ); } ?>
</em>
</time>
</div>
</div>
</div>
		  
<?php } 