Problem with relationships
-
Hi,
There are two relationship fields in my post, one of theme is for selecting the author and the other one is for selecting a book.
When i do reverse query everything goes fine and ALM works fine. but when it comes to author relationship field it queries current post title and permalink instead of author.
this is the code that i use in repeater template:<?php $selectAuthor = get_field('author_book_relation'); if( $selectAuthor ){ ?> <?php foreach( $selectAuthor as $p): ?> <?php esc_html_e( 'Analysist: ', 'pastishow' ); ?> <a href="<?php echo get_permalink( $p->ID ); ?>"> <?php echo get_the_title( $p->ID ); ?> </a> <?php endforeach; ?> <?php } ?>
How can i fix this issue so that ALM query the relationship inside repeater template?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problem with relationships’ is closed to new replies.