Created
October 11, 2019 09:31
-
-
Save Balachandark/7c55bcb11fa1ec39f6e07fc110fd5974 to your computer and use it in GitHub Desktop.
Update the authors link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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