Answer the question
In order to leave comments, you need to log in
Display posts by custom field in WordPress (ACF plugin)?
Good time everyone.
Guys, help me find the error, please. The site has a slider, images are displayed using the fields of the ACF plugin. Everything is fine, but the first 10 posts are displayed in the slider by default. And I need to display posts in which the slider field is not empty (well, or the field in which there is an image). I feel like I'm missing something, but I don't see what yet.
When I changed the code to display by tags (in the post where there is a slider, I added the slider tag), everything began to be displayed as it should. But that's not a solution. And add a slider to the post, and a tag (((
Answer the question
In order to leave comments, you need to log in
Checking the field for emptiness, if not empty, we display the block
<?php if ( get_field('slider') ) : ?>
<div class="single-top-slider-armida">
</div>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question