Skip to content

Instantly share code, notes, and snippets.

@milohuang
Created April 8, 2012 02:27
Show Gist options
  • Save milohuang/2333871 to your computer and use it in GitHub Desktop.
Save milohuang/2333871 to your computer and use it in GitHub Desktop.
<?php
global $my_connection_type;
// Find connected pages
$connected = $my_connection_type->get_connected( get_queried_object_id() );
// Display connected pages
if ( $connected->have_posts() ) :
?>
<?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) the_post_thumbnail(array(115,115), array('class' => 'tooltip')); else { ?>
<img src="<?php $values = get_post_custom_values("Thumbnail"); echo $values[0]; ?>" alt="<?php the_title(); ?>" width="115" height="115" />
<?php } ?>
</a>
</li>
<?php endwhile; ?>
<?php
// Prevent weirdness
wp_reset_postdata();
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment