Skip to content

Instantly share code, notes, and snippets.

@joeyblake
Created March 14, 2012 17:10
Show Gist options
  • Save joeyblake/2037956 to your computer and use it in GitHub Desktop.
Save joeyblake/2037956 to your computer and use it in GitHub Desktop.
<?php foreach ( $recipe_vars['instructions'] as $instruction ) { ?>
<p itemprop="recipeInstructions" >
<?php
if ($instruction['image_id'] != ""){
$inst_image = wp_get_attachment_image_src( $instruction['image_id'], "medium", false );
echo "<img src='{$inst_image[0]}' style='float:left;' /> ";
}
if (count($instruction['text']) > 1 ) {
echo '<ol>';
foreach ($instruction['text'] as $numbered_inst ){
echo '<li>'.$numbered_inst.'</li>';
}
echo '</ol>';
} else {
echo $instruction['text'][0];
}
?>
<div class="clear"></div>
</p>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment