ID;
$aid = $post->post_author;
$m = get_the_time('m');
$d = get_the_date('F j');
$y = get_the_time('Y');
$month_url = get_month_link($y, $m);
$year_url = get_year_link($y);
$date = '';
$date .= ''.$d.', ';
$date .= ''.$y.'';
$author = '';
if ( function_exists( 'coauthors_posts_links' ) ) {
$author .= coauthors_posts_links(null, null, null, null, false);
} else {
$author .= '';
$author .= get_the_author_meta('display_name', $aid);
$author .= '';
}
$author .= '';
return '' . $date . '
- ' . $author . '';
}
function benjamin_posted_on() {
echo benjamin_get_posted_on();
}
function benjamin_get_posted_on(){
global $post;
$id = get_the_ID();
$m = get_the_time('m');
$d = get_the_date('F j');
$y = get_the_time('Y');
$month_url = get_month_link($y, $m);
$year_url = get_year_link($y);
$date = '';
$date .= ''.$d.', ';
$date .= ''.$y.'';
$author = '';
if ( function_exists( 'coauthors_posts_links' ) ) {
$author .= coauthors_posts_links(null, null, null, null, false);
} else {
$author .= '';
$author .= ' - ' .get_the_author();
$author .= '';
}
$author .= '';
$output = '';
$output .= '' . $date . '';
$output .= ' - ' . $author . ''; // WPCS: XSS OK.
return $output;
}
if ( ! function_exists( 'benjamin_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function benjamin_entry_footer() {
// Hide category and tag text for pages.
if ( 'page' !== get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
if ( $categories_list = benjamin_get_the_category_list() ) {
printf( '' . esc_html__( 'Posted in %1$s', 'benjamin' ) . '', $categories_list ); // WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__( ', ', 'benjamin' ) );
if ( $tags_list ) {
echo "
";
printf( ' ' . esc_html__( 'Tagged %1$s', 'benjamin' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo "
";
echo ' ';
}
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', 'benjamin' ),
the_title( '"', '"', false )
),
'
',
''
);
}
endif;
function benjamin_get_the_category_list($id = null) {
// esc_html__( ', ', 'benjamin' )
$cats = get_the_category($id);
$output = '';
$count = 0;
foreach($cats as $cat):
if($cat->term_id == 1 && ($cat->slug == 'uncategorized') || ($cat->name == 'Uncategorized'))
continue;
$output .= ''.$cat->name.', ';
$count ++;
endforeach;
if($count == 0)
return false;
$output = rtrim($output, ', ');
return $output;
}