<?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(); 
if($background_on) { ?>				 
<div class="zmImg"><img class="rounded-lg d-block mx-auto mt-3 mb-3 mb-md-4" 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']; } ?>" alt="<?php the_title();?>" width="1024" height="500" <?php if($thumbnails_bg_alt || $thumbnails_bg_alts ) { ?>style="max-width: 100%;max-height: 320px;"<?php } ?>></div>
<?php } 