<!-- start slider -->	
<?php 
$attachments = rwmb_meta( 'kk_imgpost', 'type=image_advanced' );
		
if ( !empty( $attachments ) ) : ?>	

	<div class="slider-wrapper">
			<div id="kk_post_slider_<?php the_ID(); ?>" class="royalSlider rsDefault kk-slider-ef">
				<?php 
					foreach ($attachments as $attachment) { 					
						if ( get_theme_mod( 'kktfwp_blog_sidebar' ) !== 'full' && ! get_theme_mod( 'kktfwp_blog_single' ) ) {
							$image_size = 'medium_large';
						} else {
							$image_size = 'large';
						};

						echo wp_get_attachment_image( $attachment['ID'], $image_size, '', array( 'class' => 'rsImg', 'title' => $attachment['title'], 'alt' => $attachment['caption'], 'data-lazy-load' => 0 ) );
					} 
				?>
			</div>
	</div>
<?php endif; ?>	
<!-- end slider --> 