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"> </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>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.