Answer the question
In order to leave comments, you need to log in
How to give different attributes to elements in an array?
Good afternoon. I display an array of entries on the WP page, there is a photo gallery in the array. The problem is that all photos are combined into one gallery (lightbox) by default. How to make it easier to make each post's photo gallery have its own group: group1, group2, and so on.
<?php foreach ($posts as $post) : setup_postdata ($post); ?>
<div style="clear:both;"></div>
<li id="action_one_item" class="action-one-item">
<ul class="port_tab">
<li class="photo_tab">Фотоотчет</li>
<li class="video_tab">Видеометариалы</li>
</ul>
<div class="for_photo"><?php echo get_post_meta($post->ID, 'photo_portfolio', true); ?></div>
<div class="for_video"><?php echo get_post_meta($post->ID, 'video_portfolio', true); ?></div>
<div class="action_one_item_content"> <?php the_content(); ?> </div>
</li>
<?php endforeach; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question