Home › Forums › ACF PRO › Custom Post Type ACF Field in Header › Reply To: Custom Post Type ACF Field in Header
Hi @kikadesign
Since you are outside the loop, you will have to also pass in the Post ID (using get_the_id()) when using: have_rows in the format:
while ( have_rows('book_reviews', get_the_id()) ): the_row();
However, with the above code… you cannot pass in the ID until after this line:
while( $my_secondary_loop->have_posts() ): $my_secondary_loop->the_post();
So… you will have to come up with different logic to check if there are any rows, and to wrap your unordered list, but I imagine this will get you on the right track.
Please mark as resolved or feel free to ask more q’s if needed.. I will subscribe to this thread.
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.