Last active
July 27, 2020 23:14
-
-
Save barbwiredmedia/8428881 to your computer and use it in GitHub Desktop.
Wordpress acf relationship field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$testimonial_check = get_field('your_relationship_field_name'); | |
if ($testimonial_check) { | |
?> | |
<?php foreach (get_field('your_relationship_field_name') as $relationship): ?> | |
<p>"<?php echo get_post_meta($relationship->ID, 'some_field_content', true); ?>"</p> | |
<small><?php echo get_the_title($relationship->ID); ?> | <?php echo get_post_meta($relationship->ID, 'some_more_field_content', true); ?> </small> | |
<?php endforeach; ?> | |
<?php } ?> | |
<?php //var_dump( get_field('relationship') );?> | |
<?php | |
$posts = get_field('success_story_selector'); | |
if( $posts ): ?> | |
<?php foreach( $posts as $post): ?> | |
<?php setup_postdata($post); ?> | |
<?php the_field('story_information') ;?> | |
<?php endforeach; ?> | |
<?php wp_reset_postdata(); ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment