Answer the question
In order to leave comments, you need to log in
Have_post() loop not working properly?
There is a loop for getting posts:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php echo get_permalink();?>">
<article class="col project-card">
<div class="project-outer">
<div class="project-image">
<?php echo the_post_thumbnail('project-thumbnail'); ?>
</div>
<div class="project-text">
<h3><?php the_title();?></h3>
<div class="project-info">
<div class="project-square">
<div class="project-info-img">
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/img/info.svg" alt="">
</div>
<span><?php echo get_post_meta(get_the_ID(), '_k_area', true); ?>м²</span>
</div>
<div class="project-price">
<?php $sale = get_field('project-sale');
if( $sale && in_array('checked', $sale) ) {
?>
<p class="sale"><?php echo get_post_meta(get_the_ID(), '_k_price_max', true); ?>€</p>
<strong>от <?php the_field('project-price-1'); ?>€</strong>
<?php
}else{?>
<strong><?php echo get_post_meta(get_the_ID(), '_k_price_max', true); ?>€</strong>
<?php
}
?>
</div>
</div>
</div>
<a class="project-link" href="">Подробнее</a>
</div>
</article>
</a>
<?php endwhile; endif;?>
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