Support

Account

Home Forums General Issues Warning whith Relationship Fields Reply To: Warning whith Relationship Fields

  • Hi !
    I find this solution with query !
    This code work perfectly.

    ` $sidebar = get_field(‘sidebar-widget’);
    $args = array(
    ‘post_type’ => ‘sidebar-widget’,
    ‘page_id’ => $sidebar
    );
    $query = new WP_Query( $args );
    // The Loop
    ?>
    <?php if($query->have_posts()) : ?>
    <?php while($query->have_posts()) : ?>
    <?php $query->the_post(); ?>
    <?php include(‘widget/content-sidebar-widget.php’); ?>
    <?php endwhile; ?>
    <?php wp_reset_postdata(); ?>
    <?php endif; ?>`