Home › Forums › General Issues › Relationship Field table › Reply To: Relationship Field table
i’m new in php and for my problem found solution. but still have problem to show the result in frontend. i need each item write in own row:
please someone check the code and tell me about problem in this code:
<table> <tr> <th>heading 1</th> <th>heading 2</th> <th>heading 3</th> <th>heading 4</th> </tr> <?php $posts = get_field('relationship'); //4x post in relationship field linked if( $posts ): ?> <?php foreach( $posts as $p ):?> <tr> <td> <a href="<?php echo get_permalink( $p->ID ); ?>"><?php echo get_the_title( $p->ID ); ?></a> </td> </tr> <?php endforeach; ?></table> <?php endif; ?>
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.