Home › Forums › Add-ons › Repeater Field › Build a Table with Repeaterfield › Reply To: Build a Table with Repeaterfield
More than likely there is a problem with ACF finding the right post to get the information from, you may need to tell ACF what post id to get it from
[insert_php]
global $post;
// Wenn mindestens 1 Datensatz vorhanden ist
if( have_rows('stellen_ds', $post->ID) ) {
<table><tr><td>Stelle</td><td>Ort</td></tr>
while( have_rows('stellen_ds', $post->ID)) : the_row();
// Bezeichnung aus Feld laden
$bezeichnung = get_sub_field('bezeichnung');
// Ort aus Feld laden
$ort = get_sub_field('ort');
// Anhang Text aus Feld laden
//$anhang = get_sub_field('anhang');
echo '<tr><td>';
echo $bezeichnung;
echo '</td><td>';
echo $ort;
echo '</td></tr>';
// 3 Felder ausgeben
//echo $anhang;
endwhile;
echo '</table>';
}
[/insert_php]
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!
In this article, we take a close look at WordPress custom fields and compare them to the custom fields possible with ACF: https://t.co/hk3yibkHyk
— Advanced Custom Fields (@wp_acf) July 14, 2022
© 2022 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.