Support

Account

Home Forums Add-ons Flexible Content Field Flexible Content Field in Group correct request

Helping

Flexible Content Field in Group correct request

  • Hi everyone! Ihave Flexible content field in a Group field. How to request to Flexible content correctly?
    https://prnt.sc/ts0jja
    And such code:

    <?php
    	if( have_rows('content') ):
    	    while ( have_rows('content') ) : the_row();
    	        if( get_row_layout() == 'paragraph' ):
    	            $text = get_sub_field('text');
    	            echo $text;
    	        elseif( get_row_layout() == 'download' ): 
    	            $file = get_sub_field('file');
    	            echo $file;
    	        endif;
    	    endwhile;
    	endif;
    ?>

    If it’s out of Group it works. But in, of course, not. So how i have to request to it? Thanks in advance!

  • Already solved:

    <?php
    	if( have_rows('group_content') ):
    	    while ( have_rows('group_content') ) : the_row();
    	        if( get_row_layout() == 'paragraph' ):
    	            $text = get_sub_field('text');
    	            echo $text;
    	        elseif( get_row_layout() == 'download' ): 
    	            $file = get_sub_field('file');
    	            echo $file;
    	        endif;
    	    endwhile;
    	endif;
    ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.