Support

Account

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

Helping

Flexible Content Field in Group correct request

    • romveld

    • August 1, 2020 at 7:42 am

    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!

    • romveld

    • August 1, 2020 at 4:36 pm

    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.

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.