Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active August 2, 2023 19:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generatepress/67fb28af5c8be3103290 to your computer and use it in GitHub Desktop.
Save generatepress/67fb28af5c8be3103290 to your computer and use it in GitHub Desktop.
Remove the link to the author page
add_filter( 'generate_post_author_output','tu_no_author_link' );
function tu_no_author_link() {
printf( ' <span class="byline">%1$s</span>',
sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <span class="fn n author-name" itemprop="name">%4$s</span></span>',
__( 'by','generatepress'),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
esc_html( get_the_author() )
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment