вы можете сделать это с помощью сетки CSS.проверьте фрагмент кода ниже
.svcta_listing_related_posts_ul {
list-style: none;
margin: 0px;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
display: grid;
grid-template-columns: auto auto;
}
.svcta_listing_related_posts_li {
margin-right: 75px;
}
<ul class="svcta_listing_related_posts_ul">
<li class="svcta_listing_related_posts_li">
<?php foreach( $posts as $post): ?>
<?php setup_postdata($post); ?>
<?php the_post_thumbnail('listing_post_thumbnail'); ?>
<div class="svcta_listing_related_posts_link">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>test
</a>
</div>
</li>
<li class="svcta_listing_related_posts_li">
<?php foreach( $posts as $post): ?>
<?php setup_postdata($post); ?>
<?php the_post_thumbnail('listing_post_thumbnail'); ?>
<div class="svcta_listing_related_posts_link">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>test
</a>
</div>
</li>
<li class="svcta_listing_related_posts_li">
<?php foreach( $posts as $post): ?>
<?php setup_postdata($post); ?>
<?php the_post_thumbnail('listing_post_thumbnail'); ?>
<div class="svcta_listing_related_posts_link">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>test
</a>
</div>
</li>
<li class="svcta_listing_related_posts_li">
<?php foreach( $posts as $post): ?>
<?php setup_postdata($post); ?>
<?php the_post_thumbnail('listing_post_thumbnail'); ?>
<div class="svcta_listing_related_posts_link">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>test
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
ниже выделенной части следует обернуть в li