Support

Account

Home Forums Add-ons Flexible Content Field Flexible Content to Releationship to Flexible Content Reply To: Flexible Content to Releationship to Flexible Content

  • Hi!

    I didn’t have to try that way now because I solved the problem by looking through my code once again and I found the damn problem…

    When I check for a relationship I used this code:

    <?php $widgets = get_sub_field('widgets'); if($widgets && !get_sub_field('full_width')): ?>
    <?php foreach( $widgets as $post): ?>
    <?php setup_postdata($post); ?>

    And when I then checked for the Flexible Content inside this “widget” I used this code:

    <?php if( have_rows('widgets') ): ?>
    <?php while ( have_rows('widgets') ) : the_row(); ?>

    This obviously didn’t work so I figured out that maybe the name of my flexible content “widgets” was conflicting with the relationship get_sub_field(‘widgets’). So I changed name on my Flexible Content field to “widgets_flexible” and it worked…

    Thanks anyway!