Skip to content

Instantly share code, notes, and snippets.

@Balachandark
Created October 11, 2019 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Balachandark/7c55bcb11fa1ec39f6e07fc110fd5974 to your computer and use it in GitHub Desktop.
Save Balachandark/7c55bcb11fa1ec39f6e07fc110fd5974 to your computer and use it in GitHub Desktop.
Update the authors link
add_filter( 'astra_post_author', 'change_author_links', 10, 2 );
function change_author_links( $output, $output_filter ) {
ob_start();
echo '<span ';
echo astra_attr(
'post-meta-author',
array(
'class' => 'posted-by vcard author',
'itemtype' => 'https://schema.org/Person',
'itemscope' => 'itemscope',
'itemprop' => 'author',
)
);
echo '>';
// Translators: Author Name. ?>
<a class="url fn n" title="<?php printf( esc_attr__( 'View all posts by %1$s', 'astra' ), get_the_author() ); ?>"
href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author" itemprop="url">
<span class="author-name" itemprop="name"><?php coauthors_posts_links() ?></span>
</a>
</span>
<?php
$output = ob_get_clean();
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment