Created
February 27, 2012 12:06
-
-
Save jchristopher/1923298 to your computer and use it in GitHub Desktop.
Handlebars.js & WordPress Templates - Team Member Spotlight
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is referenced in its parent article