I'm getting "an undefined variable in line 6" while trying to display an image from a custom field. It's pulling the name/link of file; but not image. Here is my code
<?php query_posts( 'cat=36&post_type=athletes&showposts=1&orderby=rand'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
<a href="<?php the_permalink() ?>">Read More</a>
<?php $imageid = get_post_meta($post->ID, 'athletethumbnail', true); ?>
<img src="<?php echo wp_get_attachment_url( $imageid ); ?>" height="192" width="192" />
<?php the_title(); ?>
</article>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
