Created
October 9, 2012 01:12
-
-
Save davemac/3855984 to your computer and use it in GitHub Desktop.
WordPress reverie_entry_meta revised
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
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