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?