Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

How can i add ”View Profile” link so that when click it will link to that user profile (8 posts)

Started 9 months, 1 week ago by: funmi omoba

  • Profile picture of funmi omoba funmi omoba said 9 months, 1 week ago:

    Hi, i will like to add “View Profile” link in members-loop. can someone please help me with the code or point me into right direction of the code.

    thank you.

  • Profile picture of Tammie Lister karmatosed said 9 months, 1 week ago:

    A in view your profile or view the members profile? I ask as two different things.

  • Profile picture of pcwriter pcwriter said 9 months, 1 week ago:

    @funmi-omoba

    In members-loop.php, simply add the following inside <div class="item-title">
    <a class="button" href="<?php bp_member_permalink(); ?>

    Then in style.css of your child-theme, add
    `#members-list .item-title a.button { float:right; }

    You’ll wind up with a button styled just like all other buttons in your theme, linked to each member’s profile, sitting nicely on the right side. Edit the styling if you don’t want it on the right :-)

  • Profile picture of pcwriter pcwriter said 9 months, 1 week ago:

    Sorry, that line should be:
    <a class="button" href="<?php bp_member_permalink(); ?>View Profile</a>

  • Profile picture of funmi omoba funmi omoba said 9 months, 1 week ago:

    @pcwriter thanks so much, will check it out.

  • Profile picture of funmi omoba funmi omoba said 9 months, 1 week ago:

    @pcwriter, i dont know why this is not working for me, i put it in members-loop.php in my child theme, but nothing shows.

  • Profile picture of pcwriter pcwriter said 9 months, 1 week ago:

    @funmi-omoba

    You’re right, it won’t work ‘cuz there are typos in the code… sorry, my bad :-(

    Find this in members-loop.php (around line 30)

    <div class="item-title">
         <a href="<?php bp_member_permalink() ?>"><?php bp_member_name() ?></a>
              <?php if ( bp_get_member_latest_update() ) : ?>
                   <span class="update"> - <?php bp_member_latest_update( 'length=10' ) ?></span>
              <?php endif; ?>
    </div>

    …and replace with this:

    <div class="item-title">
         <a href="<?php bp_member_permalink() ?>"><?php bp_member_name() ?></a>
         <a class="button" href="<?php bp_member_permalink(); ?>">View Profile</a>
              <?php if ( bp_get_member_latest_update() ) : ?>
                   <span class="update"> - <?php bp_member_latest_update( 'length=10' ) ?></span>
              <?php endif; ?>
    </div>

    Then add this to your child-theme’s style.css
    #members-list .item-title a.button {float:right;}

    I just tested it and it works fine. Remember to respect the file structure in your child-theme: members/members-loop.php

  • Profile picture of funmi omoba funmi omoba said 9 months, 1 week ago:

    @pcwriter, you are a star, thumb up. it now fire on.

    works great

    thanks