Display images with get_field() and a category [closed]

Question

I’m trying to display the images here for only the posts with the category 2.
But this is not working…
I’m using advanced custom fields plugin.
Here is my code

   <?php 
$post_id = "category_2";



$images = get_field('gallery', $post_id);
if( $images ): ?>
            <div class="entete"> 
        <?php foreach( $images as $image ): ?>
                <div class="entete-ind"><img src="<?php echo esc_url($image['sizes']['large']); ?>"/></div>
            
        <?php endforeach; ?>
            </div>
<?php endif; ?>
0
, pual 1 year 2020-07-21T12:10:36-05:00 0 Answers 50 views 0

Leave an answer

Browse
Browse