Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created February 27, 2012 12:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/1923298 to your computer and use it in GitHub Desktop.
Save jchristopher/1923298 to your computer and use it in GitHub Desktop.
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

This gist is referenced in its parent article

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