Keyword

K2 v2.11 avatar issue

  • talgabout
  • talgabout's Avatar Topic Author
  • Offline
  • New Member
More
1 year 10 months ago #180653 by talgabout
K2 v2.11 avatar issue was created by talgabout
Hello. Thank you for the update we've all been waiting for!

 <?php if(file_exists(JPATH_BASE.K2HelperUtilities::getAvatar($this->item->author->id)) && is_file(JPATH_BASE.K2HelperUtilities::getAvatar($this->item->author->id))): ?>   
                                <div class="news-author__avatar">
                                <?php echo '<img src="'.K2HelperUtilities::getAvatar($this->item->author->id,null, 50).'" alt="'.$this->item->author->name.'"/> '; ?>
                                </div>
                            <?php endif; ?>

This code displayed the avatar of the author of the article

After the update, the avatar stopped being displayed. Tell me how to fix this problem!

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #180655 by JoomlaWorks
Replied by JoomlaWorks on topic K2 v2.11 avatar issue
Change your code to this:
<?php
$avatarURL = K2HelperUtilities::getAvatar($this->item->author->id, null, 50);
if ($avatarURL):
?>   
<div class="news-author__avatar">
    <img src="<?php echo $avatarURL; ?>" alt="<?php echo $this->item->author->name; ?>"/>
</div>
<?php endif; ?>

The check you have in your if statement is wrong.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • talgabout
  • talgabout's Avatar Topic Author
  • Offline
  • New Member
More
1 year 10 months ago #180659 by talgabout
Replied by talgabout on topic K2 v2.11 avatar issue
Thank you!!!

Please Log in or Create an account to join the conversation.

More
1 year 10 months ago #180661 by JoomlaWorks
Replied by JoomlaWorks on topic K2 v2.11 avatar issue
You're welcome.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum