Support

Account

Home Forums Add-ons Flexible Content Field Yoast SEO & ACF Reply To: Yoast SEO & ACF

  • I’ll check that one out.
    It looks as if it should work (it looks a little like my solution, but more complex). But my guess is that this one won’t work on a ‘Flexible Layout’, because you have to target the sub fields (rows > layouts > sub_fields) to get the correct content.
    Say you have a Flexible layout by the name of ‘project_content’, and a row where the actual content goes into is called ‘content’ and the actual content has the field name ‘text’, you have to target that one as:

    
    if( have_rows('project_content') ):
        while ( have_rows('project_content') ) : the_row();
            if( get_row_layout() == 'content' ):
    	    $custom_content = get_sub_field( 'text', $post->ID );
    	endif;
        endwhile;
    endif;
    

    (or something like that…)