Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created March 6, 2014 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/9399465 to your computer and use it in GitHub Desktop.
Save billerickson/9399465 to your computer and use it in GitHub Desktop.
$reviews = get_post_meta( get_the_ID(), '_lc_recipe_testerschoice', true );
if ( empty( $reviews ) || empty( $reviews[0]['name'] ) || intval( $reviews[0]['name'] ) === 0 )
return;
echo '<div class="recipe-testers">';
lc_section_title( 'Testers Choice', 'h3', true, '', '' );
foreach( $reviews as $review ) {
$id = intval( $review['name'] );
if ( $id !== 0 ) {
$name = get_term( intval( $review['name'] ), 'recipe_testers' );
echo '<div class="recipe-tester-comment">';
echo '<div class="recipe-tester-name">';
echo get_avatar( 'testers@leitesculinaria.com', 48 );
$link = get_term_link( $name, 'recipe_testers' );
if( $link && !is_wp_error( $link) )
echo '<h6><a href="' . get_term_link( $name, 'recipe_testers' ) . '" rel="nofollow">' . $name->name . '</a></h6>';
echo '<p class="recipe-tester-date">';
echo get_the_date();
if ( current_user_can( 'moderate_comments' ) ) {
$url = get_edit_post_link( get_the_ID() ) . '#lc-testers-choice';
echo ' &middot; <a href="' . $url . '">Edit</a>';
}
echo '</p>';
echo '</div>';
echo wpautop( $review['text'] );
echo '</div>';
}
}
echo '</div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment