Experts pulling gravatar and not featured image

My problem is that I have installed Jobs & Experts on my site, but it is pulling people's gravatars and not the featured image for the expert listings.
I want the featured image to show up on the homepage/when the experts are called through a shortcode some people don't have gravatars.

  • viobru
    • Support

    Hi, Rachel!

    Hope you are doing great :slight_smile:

    I was checking this and I can't find any quick way to achieve this, so this would require custom code. I will ping my teammates from SLS to check if they can provide a suggestion for this. Please note that they work round the clock and they have to deal with lots of critical issues on a daily basis, so it may take a little while for them to check this and give feedback. Also, if this customization is too complex to achieve, they might suggest to hire a developer instead to assist you with it.
    Thanks for your comprehension.

    Have a nice day ahead!

    Kind regards,
    Violeta

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Rachel ,

    By default all the profile pictures are loaded via Gravatar, the Feature image is only used as an "extra" image at the top of the profile page.

    There are 3 files that will require changing the code to instead load the featured images everywhere:

    File 1:
    wp-content/plugins/jobs-plus/app/views/expert-archive/main.php - Line 49
    
    From:
    <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo $avatar ?></a>
    
    To:
    <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo get_the_post_thumbnail( $pro->id ); ?></a>
    File 2:
    wp-content/plugins/jobs-plus/app/views/expert-single/main.php - Line 11
    
    From:
    <?php echo $model->get_avatar( 420 ) ?>
    
    To:
    <?php echo get_the_post_thumbnail(); ?>
    File 3:
    wp-content/plugins/jobs-plus/app/views/landing/main.php - Line 81
    
    From:
    <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo $pro->get_avatar(640, true); ?></a>
    
    To:
    <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo get_the_post_thumbnail( $pro->id ); ?></a>

    The above edits will instead make the featured image shown everywhere, but of course there will be some CSS edits needed extra depending on your theme.

    Inform me if you need further help on this so I can provide more assistance.

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Rachel ,

    You can make 1 additional change at:

    File:
    \plugins\jobs-plus\app\views\expert-form\_avatar_upload.php - Line 4
    
    From:
    <?php echo $model->get_avatar(420) ?>
    
    To:
    <?php echo get_the_post_thumbnail( $model->id ); ?>

    This form will continue to show the Change Avatar button though and since it's not used anymore due to getting the featured images instead you might want to hide it via CSS as well.

    Tell me if you need further help!

    Regards,
    Konstantinos

    • Konstantinos Xenos
      • Rubber Duck Debugger

      Hi Rachel ,

      For the upload process to change to support Featured Images instead it means that major changes will have to be made in the plugin and that unfortunately is out of our Supports scope.

      Since you want Featured Images + Avatars Upload to work though I can propose a different solution.

      We can easily make a change to the plugins code if you like to achieve this usability instead:
      1] If the member uploads an Avatar, then this is what it will be used.
      2] If there is no Avatar and a Featured Image exists the this will be used instead.
      3] If none of the above ( Avatar / Featured Image ) exist we will try to fetch one from Gravatar.

      This way we're leaving the default plugins functionality for uploads and avatars as-is but we can also support a Featured Image in the avatars placement as well.

      If that fits the needs please do the following :

      Part 1: Revert all of the changes that you have done before. This step will get the plugin to it's original state:

      File 1:
      wp-content/plugins/jobs-plus/app/views/expert-archive/main.php - Line 49
      
      From:
      <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo get_the_post_thumbnail( $pro->id ); ?></a>
      
      To:
      <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo $avatar ?></a>
      File 2:
      wp-content/plugins/jobs-plus/app/views/expert-single/main.php - Line 11
      
      From:
      <?php echo get_the_post_thumbnail(); ?>
      
      To:
      <?php echo $model->get_avatar( 420 ) ?>
      File 3:
      wp-content/plugins/jobs-plus/app/views/landing/main.php - Line 81
      
      From:
      <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo get_the_post_thumbnail( $pro->id ); ?></a>
      
      To:
      <a href="<?php echo get_permalink($pro->id) ?>"> <?php echo $pro->get_avatar(640, true); ?></a>
      File 4:
      wp-content/plugins/jobs-plus/app/views/expert-form/_avatar_upload.php - Line 4
      
      From:
      <?php echo get_the_post_thumbnail( $model->id ); ?>
      
      To:
      <?php echo $model->get_avatar(420) ?>

      Part 2. Upload a customized file to support both Avatars + Featured Images:

      1] Download the attached .zip and extract it.
      2] You will find a file named je-expert-model.php
      3] Navigate to your wp-content/plugins/jobs-plus/app/models/ directory and rename the je-expert-model.php file that you see there to je-expert-model-backup.php.
      4] Upload the file .php file that you extracted in the directory mentioned on step 3].

      The plugin should now support both Avatars + Featured images as described above.

      If you still want to change the plugins full functionality to upload featured images via the front-end since it's out of scope you can hire help from our partners page: https://premium.wpmudev.org/partners/#wpmud-hg-discounts-services

      Regards,
      Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.