Blog Author changes (blog_entry.php) when a diff user is logged in

Permalink
The actual blog page that displays the full post (blog_entry.php) shows the author at the bottom of the content. However the author name changes to whoever is logged in and viewing the page... not reflecting the actual author of the post.

I've looked at the code that is supposed to display the blog's author and see that the echo code is calling for $userName. So, I'm assuming that the username of whoever is logged in at the time is being displayed.

I'm unable to get the actual author to display and I've searched a fair bit.

Could someone please advise as to how I can fix this?

Note: I'm not a PHP expert... I'm just learning, so I'd appreciate example code.

Thanks in advance.
- Michael -

 
digitalkarate replied on at Permalink Best Answer Reply
Hi, Also a beginner when it comes to PHP. I found a snippet of code on another page that helped me with the same issue. I'm using the 'Greek Yogurt" template and located the following 'chunk' of code in the blog_entry.php file which 'prints' the logged-in user's name

<?php   echo $userName; ?>


I replaced the snippet above with the code I found so that it prints the Author's name instead

<?php  echo $c->getVersionObject()->getVersionAuthorUserName(); ?>


I hope this works as well for you as it did for me.
~M@~
michaelu replied on at Permalink Reply
Thanks much digitalkarate.

Works like a charm.

- Michael -