I want to show post's uploaded images but it doesn't show... What am I doing wrong?
$gallery = array();
if ( function_exists('fw_get_db_post_option') ) {
$gallery = fw_get_db_post_option( $post->ID, 'gallery', true );
}
if( !empty( $gallery ) ) { ?>
<div class="tg-innerbannerholder">
<div id="tg-innerbannerslider" class="tg-innerbannerslider tg-ad-gallery owl-carousel" data-pswp-uid="1">
<?php
foreach( $gallery as $key => $value ) {
$thumb = listingo_prepare_image_source($value['attachment_id'],480,380);
?>
<figure class="item" itemprop="associatedMedia" itemscope itemtype="">
<a class="spv-ag-gallery" href="<?php echo esc_url( $value['url'] ); ?>" data-rel="prettyPhoto[gallery]">
<img src="<?php echo esc_url( $thumb ); ?>" alt="<?php echo esc_attr( get_the_title( $value['attachment_id'] ) ); ?>">
</a>
</figure>
<?php } ?>
</div>
<?php
$script = "
jQuery(document).ready(function(){
jQuery('#tg-innerbannerslider').owlCarousel({
items:4,
nav:false,
margin:0,
loop:true,
dots:false,
center: true,
autoplay:false,
rtl: ".listingo_owl_rtl_check().",
smartSpeed:450,
responsive:{
0:{items:1,},
992:{items:2,},
1200:{items:4,}
},
navClass: ['tg-btnprev', 'tg-btnnext'],
navContainerClass: 'tg-innerbannerbtns',
navText: [
'<span><i class=\"lnr lnr-chevron-left\"></i></span>',
'<span><i class=\"lnr lnr-chevron-right\"></i></span>',
],
});
});";
wp_add_inline_script('listingo_callbacks', $script, 'after');
?>
</div>
<?php } ?>