Using Gravatar image for post authors only

Hi,

Iā€™m using the Ethos stack. Because some posts have hundreds of comments, I disabled gravatars on the site to improve performance. That works, but it also disabled the display of the photo in the ā€˜About the Authorā€™ bio section of each post.

Whatā€™s the best way of enabling gravatars only for the author bio, while leaving them disabled (or perhaps just using a static default image) for all comments?

I could use a plugin like ā€˜Simple Local Avatarsā€™ to upload an image for each author, but there are quite a few of them, and Iā€™d rather not use a plugin for something like this if a simple code change can achieve the same thing, since all authors are set up with gravatars already.

Hi There,

Please try with this solution:

http://qnimate.com/wordpress-disable-comments-avatar-only/

Hope that helps and thank you for understanding.

Thanks for the suggestion! I put that code snippet into my child functions.php, but it doesnā€™t seem to do what itā€™s supposed to (or anything at all, really).

Any other thoughts?

Cheers

Hey There,

Iā€™ve tested the code and itā€™s working fine on my local installation.

Please try testing a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If itā€™s fixed, youā€™ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If it doesnā€™t help, would you mind providing us with your admin account so we can take a closer look?

Thanks.

Disabling all plugins didnā€™t change anything. Iā€™ll send you a secure note with the login details.

Hello @tma_dave,

Thanks for updating in! I have logged in to your site and I found out the there is no file editor in Appearance > Editor. This is due to file permission or file editing is not allowed. We cannot fully troubleshoot the code since we do not have any access to your child themeā€™s functions.php file. Please provide us ftp access so that we can test out the code and see why it is not working.

Regards.

Iā€™m not able to provide you the ftp access details, unfortunately. If thereā€™s a secure way to send you a copy of the functions.php file, however, Iā€™m happy to do that.

Hello @tma_dave,

Thanks for updating the thread. :slight_smile:

You can share the function.php file either by uploading the file using online file sharing applications like Dropbox. Or you can share the code directly here using Secure note feature. However, to avoid any confusion please share the Dropbox link for us to take a closer look.

Having said that I see you are using old version of X Theme 6.2.5 and Cornerstone 3.2.5. Please note that using old version of X Theme and Cornerstone can cause compatibility issues plus more importantly new version of any software comes with bug fixes and host of new features and functions.

To update Cornerstone and X Theme please take a look at following resources:

  1. Version compatibility guide: To learn about the latest and compatible versions of bundled and supported plugins, please take a look at following doc:


2. Theme Update guide: Please take a look at following article to update Cornerstone.


3. Please take a look at following doc about changelog:

https://theme.co/changelog/

Thanks.

Iā€™ve uploaded the child functions.php to Dropbox and shared the link in the secure note.

Cornerstone and the X theme were outdated because youā€™re accessing the staging site, which I hadnā€™t updated for a while. Iā€™ve updated both to the latest version, but it hasnā€™t changed the gravatar images.

Thanks!

Hi @tma_dave

Upon checking, I can confirm the issue on your end. To check your issue further, we will require your FTP credentials to check your child theme setup.

Thanks!

What do you mean ā€œcheck your child theme setupā€? As I mentioned earlier, I canā€™t provide the FTP credentials, so please let me know what you need to check and Iā€™ll do it for you.

Hi @tma_dave

I have used the exact functions.php file that you have provided above on my test site and I can confirm that the code is functioning exactly as expected.

Your issue is something related to your server configurations/ child theme setup or something related which you need to troubleshoot. I would suggest you to enable WP_DEBUG mode (https://codex.wordpress.org/WP_DEBUG) and then revisit your posts to see if youā€™re getting any PHP errors. Also you can try switching to a PHP version between PHP 5.6.x and 7.1.x and see if that helps.

If you require further assistance, I would suggest you to contact a developer or a service.

Thank you!

Thanks for that ā€“ I enabled DEBUG but didnā€™t see anything show up in the error logs etc. In the end I decided to just try implementing the code on the production site anyway, and it worked perfectly ā€“ so whatever the problem was, it was only on staging.

Appreciate the assistance!

Hi @tma_dave,

In that case, would you mind providing your FTP login credentials as well? And please provide the exact URL where we can check this issue.

The admin has no capability to edit and check the theme files, then have to check it through FTP.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.