Al final pones un endif; que no pinta nada.
¿Qué tal así? No lo he probado pero debería funcionar ^^
Código PHP:
<?php
function admired_posted_on() {
if ( in_category( '18' ) ) {
printf( __( '<span class="sep"></span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></span>', 'admired' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'admired' ), get_the_author() ),
esc_html( get_the_author() ) );
} elseif ( in_category ('15', '20') ) {
printf( __( '<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">%7$s</span></span>', 'admired' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'admired' ), get_the_author() ),
esc_html( get_the_author() ) );
}
}