Last active
May 23, 2022 00:16
-
-
Save Shelob9/6679914 to your computer and use it in GitHub Desktop.
Get related posts from a Pods custom relationship field and show post title--as a link--and a custom field. For full explanation see: http://pods.io/tutorials/get-values-from-a-custom-relationship-field/
Sorry this is not working. I have not worked with Pods in awhile and can not help resolve this. Please see this page for Pods support options.
It works for me, tried using a snippet in elementor.
You need to change 'pod_name' and 'relationship_field' with the real entity and field name, the rest is okay.
Thanks @Shelob9
It works for me, tried using a snippet in elementor.
You need to change 'pod_name' and 'relationship_field' with the real entity and field name, the rest is okay.
Thanks @Shelob9
It works for me too! Thanks!
field( 'ttulos_en_los_que_imparte_clase' );
//loop through related field, creating links to their own pages
//only if there is anything to loop through
if ( ! empty( $related ) ) {
foreach ( $related as $rel ) {
//get id for related post and put in ID
//for advanced content types use $id = $rel[ 'id' ];
$id = $rel[ 'ID' ];
//show the related post name as link
echo ''.get_the_title( $id ).'';
//get the value for some_field in related post and echo it
$someField = get_post_meta( $id, 'ttulos_en_los_que_imparte_clase', true );
echo $someField;
} //end of foreach
} //endif ! empty ( $related )
?>
This code is showing critical error for me with Oxygen Builder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this code is not working for me