Hello,
I have followed the tutorial here to add the author to the blog grid:
https://kriesi.at/support/topic/change-meta-on-grid-blog-posts/
However, if you click on the author link, it does not link properly. I would like it to link to the author/user’s archive, such as http://jamesattorneymarketing.com/author/lwilson/.
It seems to be defaulting to “James Publishing Staff” and pulling up a 404.
Here is our blog grid: http://jamesattorneymarketing.com/education/
Any ideas? Thanks!
Hey Sofia!
Use this code instead:
if($show_meta && !empty($excerpt))
{
$output .= "<div class='slide-meta'>";
if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio')
{
$link_add = $commentCount === "0" ? "#respond" : "#comments";
if($commentCount == "0")
{
$text_add = __('Contribute', 'avia_framework' );
}
else
{
$text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' );
}
$output .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a></div><div class='slide-meta-del'> | </div>";
}
$output .= "<div class='slide-meta-time'>" .get_the_time(get_option('date_format'), $the_id)."</div>";
$author_id = $entry->post_author;
$author_url = get_site_url()."/author/".get_the_author_meta( 'user_nicename' , $author_id );
$author_name = get_the_author_meta( 'display_name' , $author_id );
$output .= 'by <a href="'.$author_url.'">'.$author_name.'</a>';
$output .= "</div>";
}
Cheers!
Josue
Brilliant, thank you! Works perfectly.
Glad we could help :)
Regards,
Josue