Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created February 27, 2012 12:06
Show Gist options
  • Select an option

  • Save jchristopher/1923298 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
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