Home › Forums › General Issues › relationship field sort order › Reply To: relationship field sort order
Try changing these to lines:
if (count($case) > 0) {
foreach( $case as $cliente2 ):
to
if (count($case->posts) > 0) {
foreach( $case->posts as $cliente2 ):
I don’t understand what you’re trying to do here
<a href="<?php echo get_permalink( $case->ID ); ?>">
$case in your code is a WP_Query object, so $case->ID has no value.
To get a better idea of what $case holds you can do this so that you can see everything that’s in it.
echo '<pre>'; print_r($case); echo '</pre>';
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.