my custom author Excerpt description plugin doesnt work

i want to show that top authors with avatars and description so i need excerpt the descriptions.

function.php:

// Top Authors–>
function author_excerpt (){
$word_limit = 2; // Limit the number of words
$more_txt = ‘read more about:’; // The read more text
$txt_end = ‘…’; // Display text end
$authorName = get_the_author();
$authorUrl = get_author_posts_url( get_the_author_meta(‘ID’));
$authorDescriptionShort = wp_trim_words(strip_tags(get_the_author_meta(‘description’, $contributor_id)), $word_limit, $txt_end.'<br /> ‘.$more_txt.’ <a href=”‘.$authorUrl.'”>’.$authorName.'</a>’);
return $authorDescriptionShort;
}

function twentyfourteen_list_authors() {
$contributor_ids = get_users( array(
‘fields’ => ‘ID’,
‘orderby’ => ‘post_count’,
‘order’ => ‘DESC’,
‘who’ => ‘authors’,
) );

foreach ( $contributor_ids as $contributor_id ) :
$post_count = count_user_posts( $contributor_id );

// Move on if user has not published a post (yet).
if ( ! $post_count ) {
continue;
}
?>

<div class=”contributor”>
<div class=”contributor-info”>
<div class=”contributor-avatar”><?php echo get_avatar( $contributor_id, 132 ); ?></div>
<div class=”contributor-summary”>
<h2 class=”contributor-name”><?php echo get_the_author_meta( ‘display_name’, $contributor_id ); ?></h2>
<p class=”contributor-bio”>
<?php echo get_the_author_meta( ‘description’, $contributor_id ); ?>
<?php if (function_exists(‘author_excerpt’)){echo author_excerpt();} ?>
</p>
<a class=”button contributor-posts-link” href=”<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>”>
<?php printf( _n( ‘%d Article’, ‘%d Articles’, $post_count, ‘twentyfourteen’ ), $post_count ); ?>
</a>
</div><!– .contributor-summary –>
</div><!– .contributor-info –>
</div><!– .contributor –>

<?php
endforeach;
}

// /Top Authors –>

from widget php file:

echo twentyfourteen_list_authors();

link:

http://www.themeforest-deneme.deniz-tasarim.site/

Read more here:: my custom author Excerpt description plugin doesnt work

Leave a Reply

Your email address will not be published. Required fields are marked *