Skip to content

Instantly share code, notes, and snippets.

@davemac
Created October 9, 2012 01:12
Show Gist options
  • Save davemac/3855984 to your computer and use it in GitHub Desktop.
Save davemac/3855984 to your computer and use it in GitHub Desktop.
WordPress reverie_entry_meta revised
function reverie_entry_meta() {
$num_comments = get_comments_number();
$tags=get_the_tag_list(' ', ', ');
$output ='';
$output .= '<div class="entry-meta"><p>';
$output .= '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('%s'), get_the_time('jS F Y')) .'</time>, ';
// $output .= comments_number( 'No comments yet', '1 comment', '% comments' );
if ( comments_open() ) {
if ( $num_comments == 0 ) {
$comments = __('No Comments');
} elseif ( $num_comments > 1 ) {
$comments = $num_comments . __(' Comments');
} else {
$comments = __('1 Comment');
}
if($num_comments > 0){
$output .= '<a href="' . get_comments_link() .'">'. $comments.'</a>';
}else{
$output .= $comments;
}
} else {
$output .= __('Comments are off for this post.');
}
// $output .= 'No comments yet';
if($tags){
$output .= ' <span class="tags">Tags: '.$tags. '</span>';
}
$output .= '</p></div>';
echo $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment