@DipscomHere i am once again
It works great on my own created divs, but now i am trying to build my website on Wordpress.
Im trying to show 4 news posts (with each the follow div in it).
The problem is that now all 4 news posts get the class parent parent1:
<?php
$args = array(
'post_type' => 'news',
'posts_per_page' => 4,
);
$preview = new WP_Query($args);
?>
<?php
if ( $preview->have_posts() ) :
while($preview->have_posts() ) : $preview->the_post();
?>
<div class="newsPost">
<div class="imageHolder parent parent1">
<div class="image" style="background-image: url('<?php the_field('news_image'); ?>');"></div>
<div class="follower arrow"></div>
</div>
</div>
<?php endwhile; endif; wp_reset_postdata(); ?>
Is there a way to automatically generate the parent selector?
I thought something like this:
parent parent-<?php echo $i++; ?>
But i dont know how to let this work with the Jquery you provided.
For example on my news overview page im showing like 20 posts, and every week there is a new post.