Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author anmari

    (@anmari)

    Yes of course – if done properly as wordpress intends it works beautifully.

    amr users plugin calls wp function get_avatar. Any plugin offering custom (local or remote) avatars should be using the get_avatar filter for easy seamless custom avatar. The avatar plugin’s filter function should then be looking up the appropriate local or remote custom avatar and returning that.

    https://codex.wordpress.org/Plugin_API/Filter_Reference/get_avatar
    (the sample in the codex is NOT the best because it has the id hardcoded, but the principle is there.

    THis page describes it better.
    http://www.billerickson.net/wordpress-custom-avatar/

    Thread Starter zshann

    (@zshann)

    Hi again,

    So based on the above (which thank you very much for pointing me in the right direction!)

    Using the WP User Avatar plugin (https://wordpress.org/plugins/wp-user-avatar/ I was able to get the avatar meta field to display the users avatar when I view the user list in the dashboard under user lists > configure a list > [my current list] > View [under Name of List] section.

    The problem I now have is when I try to put that list (simple or table) on a page (either manually or by pressing the add page button) the pictures do not show up. They only show up if I view the page within the dashboard as mentioned above.

    Am I missing something silly? or could another plugin causing an issue? Currently I just have the avatar meta field as display order 1, link type = none, and all other option fields are blank.

    I feel like I’m missing something incredibly simple but I’m not sure what.

    Thank you again for your help I really do appreciate it. 🙂

    Plugin Author anmari

    (@anmari)

    There is also a page cache – have you refreshed the page (should have refreshed by now though)

    The code for front and back is the same so if it displays in back it will be calling same code in front – hence either it’s a cache thing,
    Or the called function(avatar) behaves differently when called from front
    Or sometimes folks have other css that affects things – check whether the avatar html is being generated.

    Thread Starter zshann

    (@zshann)

    Hi,

    Just to give you an update, it does look like its generating the code on the front page correctly, but its displaying the avatar as a 0x0 square in the upper-right hand corner of the post/page. Which explains why I thought they weren’t being added to the page.

    Now the question is why they are displaying as 0x0 squares… lol Which I’m thinking is my problem. I’ve just been looking through my CSS to try to find what’s causing that. Because the AMR code looks perfect as shown below:

    <img src="http://my.website.com/wp-content/uploads/Default_UserIcon.png" width="150" height="150" alt="" class="avatar avatar-150 wp-user-avatar wp-user-avatar-150 photo avatar-default" data-lazy-loaded="true" style="display: block;">

    It looks like it may have something to do with the theme I’m using (Colorlib’s Sparkling) because everything effecting the style of that object are in bootstrap.min.css / style.css (that aren’t from amrusersfront.css) which would come from Sparkling.

    Thank you anmari for your help and for pointing me in the right direction. 🙂

    Plugin Author anmari

    (@anmari)

    OK – sounds like maybe you haven’t discovered the joys of web development tools like either firebug (firefox) or chrome
    ‘inpect element’

    should be able to see straight away which css is affecting, where it comes from.
    and you can untick / adjust the css realtime to debug/check

    http://www.sitepoint.com/inspect-element-troubleshooting-css-browser/
    http://getfirebug.com/css
    https://developer.chrome.com/devtools/docs/elements-styles

    Thread Starter zshann

    (@zshann)

    Found it & Fixed. 🙂

    For future reference if anyone else uses the Colorlib “Sparkling” theme and runs into this issue.

    In Stylings CSS:
    .vcard .avatar {
    position: absolute; <—- Change to Static or Relative
    left: 20px;
    top: -80px;
    border-radius: 2px;
    }

    That will at least make the pictures display for anyone using Sparkling, it still has some other styling issues that I worked out on my own, but they shouldn’t be show stoppers for anyone.

    Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Using Local Avatars’ is closed to new replies.