Support » How-To and Troubleshooting » [Resolved] adding username to post_class
7 years, 7 months ago
Reading through the post_class() text, it appears you can use an array to put text in there, so like this:
That would be correct, and I have tested it out, and it works fine.
How do I get the post’s author’s name in there though? I’ve tried using the_author_login() but it doesn’t work. $post->post_author gives the ID, not the name. Can anyone help?
Ahh found a solution:
$curauth = get_userdata(intval($post->post_author));