Home › Forums › General Issues › Homepage with Loop & ACF › Reply To: Homepage with Loop & ACF
Hi elliot,
There are two options in the Reading settings in WP back-end. Static page and posts page. I’ve set the static page option to my Homepage which uses a template that contains code that does the following (I’ve abbreviated it ofc but it fully works. It’ll either display ACF fields or the posts, never both):
Gets the Posts.
<?php while ( have_posts() ) : the_post(); ?>
...Do stuff
Afterwards, displays the ACF repeater fields.
<?php if( get_field('care_list') ): ?>
<?php while(has_sub_field('care_list')): ?>
...Do stuff
I cant set the Homepage to be a static page and posts page, but essentially I need to display both on the same page anyway. How do I do this?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.