0

I'm using redux framework gallery fields to make logo gallery. But I'm facing problem to print those on front-end. Instead of images url I got attachment ids. Could anyone please tell me how to print those ids in front-end through foreach loop? Thnx in advance :)

My redux code:

Redux::setSection($opt_name, array(
    'title'         =>      'Clients logo',
    ));

Redux::setSection($opt_name, array(
    'title'         =>      'Upload Logo',
    'subsection'    =>      true,
    'fields'        =>      array(
        array(
            'title'     =>      'Upload logos',
            'id'        =>      'blind_logo',
            'type'      =>      'gallery'
            )
        )
    ));

I want to print those ids in <img> source

<ul class="client-list">

    <li>
        <a href="#"><img src="" alt=""></a>
    </li>               

</ul>

closed as off-topic by Mark Kaplun, cjbj, Dave Romsey, Fayaz, Howdy_McGee Apr 10 '17 at 17:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

Ok, That was so nice for me. I and my mate solve the problem.

We got the images ids and put into it in a var. That was array so we put it in explode function so that we break the string into an array, and finally, we run a foreach loop to print those ids.

My code

<ul class="client-list">

    <?php global $blind_opt;

    $logo = $blind_opt['blind_logo'];

    $logos = explode(",", $logo);

    foreach($logos as $image):

    ?>
    <li>
    <a href="#"><img src="<?php $imag_var = wp_get_attachment_image_src($image); echo $imag_var[0]; ?>" alt=""></a>
    </li>
    <?php endforeach; ?>
</ul>