Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display Username – When activity disabled


  • fred9543
    Participant

    @fred9543

    I have now searched the web and couldn’t find a solution. So here the question comes.

    On my webpage I use buddypress and I don’t want the activity part of buddypress so I choosed to disabled it. But when disabling the activity part of buddypress, the username disapeares on the profile page and that’s bad because I need it to get shown. I figured out why it happens, but I need to find out how i can change it in a way which will not override it on future updates.

    The programming who make the username disabled when activity not active is this. It is found in the members-header.php (member > single folder)

    <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>*/
    	<span class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></span>
    <?php endif; ?>  

    So yes I understand how the code works, but need a “update not overriding solution” maybe it colud be made with remove_action in function.php. But I can’t figure out the right and best way to do it.

    Information:
    Version of WordPress = 4.7
    Version of BuddyPress = 2.7.4
    I can’t provide link to the webpage, because i’m testing locally at the moment.

    Thanks in advance.

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

  • pare81
    Participant

    @pare81

    Hi,

    you can test this within your themes function.php:

    add_action( 'bp_profile_header_meta', 'bp_info_viewer' );
    
    function bp_info_viewer() {
    if (function_exists('bp_displayed_user_id')) {
        $user = new WP_User( bp_displayed_user_id() );
    	echo '<span class="user-loginname">';
    	echo $user->user_login;
    	echo '</span>';
       }
    }

    within your css you can style .user-loginname { ... }

    Hope this help


    fred9543
    Participant

    @fred9543

    Thanks a lot for the help @pare81, that did the trick perfectly. It actually works now. 🙂

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