Support

Account

Home Forums General Issues how to display sub fields for specific post repeater field

Helping

how to display sub fields for specific post repeater field

  • I’m making a plugin that will display my custom field type and it’s associated custom fields, but can’t figure out how to show my custom fields. I’ve repeated 3 e

    This is my relative code section:

                // kids
                $kids = get_field ('children', $post->ID); 
    	     if( $kids ) {
                    $pdf->Ln(10);
                    $pdf->Write(12, 'we have kids1');  //shows
                    foreach( $kids as $kid ) {
                        $pdf->Ln(10); //does NOT SHOW
    		      $pdf ->Write (12, 'a kid');  //does NOT SHOW
                        $pdf->WriteHTML( $kid['name'] ); //does NOT SHOW
                    }
                }
    
    	     if( have_rows('children', $post->ID) ):
                    $pdf->Ln(10);
                    $pdf->Write(12, 'we have kids2'); //does NOT SHOW
    	         while ( have_rows('children', $post->ID) ) : the_row();
                        $pdf->Ln(10); //does NOT SHOW
                        $pdf->Write(12, 'a kid'); //does NOT SHOW
    	         endwhile;
    	     endif;
            }
        }

    This is what is being displayed:
    we have kids1

    I would expect that I would see
    we have kids1
    a kid joe
    a kid bo
    a kid duke
    we have kids2
    a kid
    a kid
    a kid

    how do I display the child subfield (name)?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.