Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handlebars.js & WordPress Templates - Team Member Spotlight
<?php global $handlebars; ?>
<?php if( !$handlebars && has_post_thumbnail() ) : ?>
<?php $headshot = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); ?>
<img src="<?php echo $headshot[0]; ?>" alt="Headshot" class="alignleft" />
<?php elseif( $handlebars ) : ?>
{{#if headshot}}
<img src="{{headshot}}" alt="Headshot of {{name}}" class="alignleft" />
{{/if}}
<?php endif; ?>
<h3><?php if( !$handlebars ) { the_title(); } else { ?>{{name}}<?php } ?></h3>
<p><a href="<?php if( !$handlebars ) { echo get_permalink(); } else { ?>{{permalink}}<?php } ?>">View more details</a></p>
@jchristopher
Copy link
Author

jchristopher commented Feb 27, 2012

This gist is referenced in its parent article

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment