Support

Account

Home Forums ACF PRO Get last row from a flexible content and display it on another page Reply To: Get last row from a flexible content and display it on another page

  • If I’m understanding you correctly, I would do this:

    $post_object = array_reverse(get_field('relation'));

    $post_object[0] will now be the last item in that array, so you can then

    <div class="titre-soustitre">
        <div class="menu-content" data-id="id-<?php echo $post_object[0]['id']; ?>">
            <p class="demo bis"><span class="sub">&nbsp;</span></p>
            <a href="#" class="expander"><h1><p class="demo title"><?php echo $post_object[0]['title'] ?></p></h1></a>              
            <p class="demo bis"><span class="sub"><?php echo $post_object[0]['subhead']; ?></span></p>
        </div>
    </div>