I then have custom fields inside each posts, (description, rating etc etc) and 2 repeaters, one for the pros, one for the cons.
Now In that Custom WP_Query Loop (Ref1) - I can easily call dynamic data (acf_description, acf_dating etc.) but when I loop on the repeaters (and I pick “ACF Repeater: Pros” from the dropdown) and include dynamic data as output (acf_pros_pro) - There is no output.
It seems odds that I can output the ACF fields but not the repeater. This repeater works well on single pages.
Not sure how to start debugging this to see where it comes from?
add a code element within your custom query loop and copy / paste this into the code element:
<?php
/* first we check, if the acf repeater has any content */
if( have_rows('zutaten_repeater') ):
/* if it has content, we loop over all content */
while ( have_rows('zutaten_repeater') ) : the_row();
if( have_rows('zutatenliste') ):
/* if it has content, we loop over the first line */
for ($i = 1; $i <= 1; $i++) {
the_row();
/* as an example, we get a text field from the sub-repeater and print it */
$sub_repeater = get_sub_field('zutat');
echo '<div>'.$sub_repeater.'</div>';
}
endif;
endwhile;
else :
/*inform the user, if the repeater has no content */
echo "Sorry, no rows found in the repeater";
endif;
?>
Replace the zutaten_repeater, the zutatenliste and zutat (these are all my acf repeater fields) with your repeater field.
Then check if content from your repeaters are shown or not.
Thank you for the code.
I put the following code based on your example in within my Custom Query Loop.
<?php
/* first we check, if the acf repeater has any content */
if( have_rows('cf_repeater') ):
/* if it has content, we loop over all content */
while ( have_rows('cf_repeater') ) :
the_row();
echo get_sub_field('subfield');
endwhile;
else :
/*inform the user, if the repeater has no content */
echo "Sorry, no rows found in the repeater";
endif;
?>
Actualy outputs the subfield.
So it seems that the Query Loop “ACF Repeater: CF Repeater” is fault since it doesn’t output anything itself
It’s a bit bothering because I had elements within that loops. The only way I see it now is going full code to output those elements, which isn’t going to be easy with the responsive design
I’m not sure I understand. The custom query actually return the good posts and output them. It can actually return ACF fields, unless it’s a repeater. So what exactly would be the cause?
I do not need to sort the repeater field, as the order is the good one yet.
I need to be able to call it within in a Custom Loop Query so I can get that list. So Far, it doesn’t work, only in pure php + html. That’s why I’m wondering why Bricks cannot do that.