Skip to content

Instantly share code, notes, and snippets.

@amanhstu
Created June 29, 2016 10:29
Show Gist options
  • Save amanhstu/ed98a1fb0b2d179567d252aad0dd5478 to your computer and use it in GitHub Desktop.
Save amanhstu/ed98a1fb0b2d179567d252aad0dd5478 to your computer and use it in GitHub Desktop.
<?php
$post_object = get_field('field');
if($post_object) :
$post = $post_object;
// Overwrite $post
setup_postdata( $post ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php
// Reset $post so the rest of the page works
wp_reset_postdata();
endif;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment