Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile Image Widget Question


  • Julia_B
    Participant

    @julia_b

    I’m not a pro developer so I use Fusion Builder on site which has the Avada theme.

    I’m having problems with a widget which simply displayed the members’ profile image on the homepage.

    Here’s the code I’m using:

    <div class=”bp-login-widget-user-avatar”>“>
    <!–?php bp_loggedin_user_avatar( ‘type=full&width=200&height=200’ ); ?–>
    </div>

    I have this in a page section which has three columns, with the profile image widget in one column and simple images linking to site content in the other two columns.

    Strangley it works, but only if placed in the 3rd column, however I’d ideally like to have it in the middle (2nd) column.

    At the moment, when this widget placed in the middle/2nd column the item in the 3rd column appears pushed down to the row below and the image displays in a smaller size.

    Is there something wrong with the code I’m using?

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

  • shanebp
    Moderator

    @shanebp

    Support for Fusion is beyond the scope of these forums.

    Perhaps Avada requires the markup that you are using, however here is the usual way:

    <div class="bp-login-widget-user-avatar"><?php bp_loggedin_user_avatar( "type=full&width=200&height=200" ); ?></div>

    You might check the html that is returned in the avatar call; it may include code that is causing your layout issues. Or the css class that you’re using

    Note: you’ll probably get a more useful response from Avada support.


    Julia_B
    Participant

    @julia_b

    Thanks @shanebp

    I wasn’t sure if the issue was related to using Avada or if the code I’m using wouldn’t work on any site.

    I tried using the code you posted above and it works fine, even with the avatar in the middle.

    But then I noticed it didn’t link through to the member profile so I tried adding this bit of code:

    <a href="<?php echo bp_loggedin_user_domain(); ?>">

    – from my original version and the issue returned.

    Could you tell me please, what code you would add to:

    <div class="bp-login-widget-user-avatar"><?php bp_loggedin_user_avatar( "type=full&width=200&height=200" ); ?></div>

    – in order to have the avatar image link to member profile?

    I’ll try your recommendation first and then if it doesn’t work I’ll head over to Avada support.

    Thanks very much for the help 🙂


    Boone Gorges
    Keymaster

    @boonebgorges

    To turn the image into a link, you’ll want something like this:

    <div class="bp-login-widget-user-avatar">
      <a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>">
        <?php bp_loggedin_user_avatar( "type=full&width=200&height=200" ); ?>
      </a>
    </div>

    If adding this link causes other content to get pushed down on the page, it’s likely that the Avada theme has some styling that is causing a elements to have some additional padding/margin, or perhaps a weird display or clear issue. Best to take it up with the Avada folks.

    Good luck!


    Julia_B
    Participant

    @julia_b

    Thanks very much for this @boonebgorges!

    I’m afraid I’m having more issues with this and the avatar has now disappeared entirely, so it must be an issue with Avada theme. I have taken it up with their support so hoping to find a solution that way.

    🙂


    Boone Gorges
    Keymaster

    @boonebgorges

    Thanks, @Julia_B! Please do follow up when the Avada folks have had a chance to look at your issue. If BP is doing something wrong, we’d like to know about it, and your experience could be a useful resource for others in the future 🙂


    Julia_B
    Participant

    @julia_b

    @boonebgorges

    I’m still looking for answer unfortunately.

    I’ve been chatting with Avada support and they seem to have come to the conclusion that what I’m asking for is not possible, not just in Avada theme but in any theme.

    I’m sure this is not correct, especially since I had it working on my site until recently. All I need is simple widget displaying each memeber’s profile image. Or it doesn’t even have to be in a widget if that’s what’s causing the issue.

    Anyway, Avada support said they attempted to do this by reverting my site to default theme and trying it out.

    They sent me this video clip which they say shows it’s not possible:

    https://www.dropbox.com/s/p91l3nfofvb04a7/2017-11-30_16-36-36.mp4?dl=0

    …So I can only think I must need to use different code.

    Any ideas please? 🙂


    Boone Gorges
    Keymaster

    @boonebgorges

    Oy, this is not a good piece of advice from the Avada support folks. You cannot put PHP into a text widget. I gave you a snippet of PHP with the understanding that it’d have to be added through code somehow.

    If you haven’t got the resources to build a proper custom widget (no worries if not, it is a bit cumbersome to do), you may try a plugin like https://wordpress.org/plugins/php-code-widget/. You should be able to paste the text in question into one of those widgets and have it work.

    Widget-friendly shortcodes for BP content is a good idea for a future enhancement. I’ve added a comment to an existing ticket we have to track a related idea. https://buddypress.trac.wordpress.org/ticket/7159#comment:2

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar