cmb2 field type : file is not displaying image on front end?
-
By using cmb2 field type => file, In backend image file was uploaded but in front end it’s not displaying, I checked with inspect element and in that found image src unknow, Please help
Shortcode section
`// Client Section Shortcode
add_shortcode(‘client-section’,’home_client_section_shortcode’);
function home_client_section_shortcode($attr,$content){
$client = extract(shortcode_atts( array(
‘title’ => ‘Oue Clients’,
‘subtitle’ => ‘Some of the best.’), $attr) );
ob_start(); ?>
<section>
<div class=”container”>
<div class=”title center”>
<h4 class=”upper”><?php echo $subtitle; ?></h4>
<h3><?php echo $title; ?><span class=”red-dot”></span></h3>
<hr>
</div>
<div class=”section-content”>
<div class=”boxes clients”><?php
$client = new WP_Query( array(
‘post_type’ => ‘agro-client’,
‘posts_per_page’ => 10));
$logo = wp_get_attachment_image( get_post_meta( get_the_id(),’_client-logo’, true),’medium’ );
while($client->have_posts()): $client->the_post();
?>
<div class=”col-sm-4 col-xs-6 border-right border-bottom”>
<img src=”<?php echo $logo; ?>” alt=”” data-animated=”true” class=”client-image”>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</section><?php return ob_get_clean();
}
- The topic ‘cmb2 field type : file is not displaying image on front end?’ is closed to new replies.