Reply To: Disabling linking to author's posts

Home Forums Support Disabling linking to author's posts Reply To: Disabling linking to author's posts

Home Forums Support Disabling linking to author's posts Reply To: Disabling linking to author's posts

#110415
Remez Sasson

I added the following script again, as per the link above, a few minutes ago, but the author’s name beneath the title is still a link.

if ( ! function_exists( ‘generate_posted_on’ ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function generate_posted_on() {

if ( ‘post’ !== get_post_type() )
return;

$time_string = ‘<time class=”entry-date published” datetime=”%1$s” itemprop=”datePublished”>%2$s</time>’;
if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) )
$time_string .= ‘<time class=”updated” datetime=”%3$s” itemprop=”dateModified”>%4$s</time>’;

$time_string = sprintf( $time_string,
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);

printf( __( ‘<span class=”posted-on”>%1$s</span> <span class=”byline”>%2$s</span>’, ‘generate’ ),
sprintf( ‘%3$s‘,
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
$time_string
),
sprintf( ‘<span class=”author vcard” itemtype=”http://schema.org/Person&#8221; itemscope=”itemscope” itemprop=”author”>%1$s <span class=”author-name” itemprop=”name”>%2$s</span></span>’,
__( ‘by’,’generate’),
esc_html( get_the_author() )
)
);
}
endif;