Support

Account

Home Forums Add-ons Flexible Content Field how to call flexible content inside group field?

Helping

how to call flexible content inside group field?

  • I have a flexible content inside a group field, I don’t understand how to call that flexible content, I tried this but it generates critical error.

    $grp = get_field('all_content');
    $flex = $grp['flex_content'];
    if( have_rows($flex) ){
    
       while ( have_rows($flex) ) {
          the_row();
            // Case: Paragraph layout.
            if( get_row_layout() == 'content' ){
             the_row();
             echo get_sub_field('flex_content');
           }
       }
    }           
    
  • 
    $grp = get_field('all_content');
    $flex = $grp['flex_content'];
    while(have_rows($grp)) {
    if( have_rows($flex) ){
    
       while ( have_rows($flex) ) {
          the_row();
            // Case: Paragraph layout.
            if( get_row_layout() == 'content' ){
             the_row();
             echo get_sub_field('flex_content');
           }
       }
    }
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.