Custom Tweaks needed

1) Trying to change the "Like" button in the following page, before the "Comment", and "Delete" buttons:
websiturl.com/g/founder

2) The Bio under the profile photo in the above mentioned page is added using the following solution:
https://premium.wpmudev.org/forums/topic/add-buddypress-profile-field-to-front-end

Would like to know whether there is any way to limit the number of words displayed under Bio to 5.

  • James Morris

    Hello skc,

    I hope you are well today. I'll be following up with you regarding your chat.

    1) Trying to change the "Like" button in the following page, before the "Comment", and "Delete" buttons:
    websiturl.com/g/founder

    You can add the following custom jQuery to a plugin like Simple Custom CSS and JS.

    jQuery(document).ready(function(){
        jQuery('.activity-meta > #ai_ar_main').each(function() {
            $(this).prependTo(this.parentNode);
        });
    });

    This will force the Like button to the beginning of the line of buttons.

    Regarding the mu-plugin you linked to. If you replace the code of that plugin with the following, it will limit the output to 5 words.

    <?php
    
    add_action( 'bp_profile_header_meta', 'display_user_profile' );
    
    function display_user_profile() {
    //This is where the code to display the user data will go.
    
    echo 'About me: ';
    
            $profile_bio = bp_get_profile_field_data( 'field=2' );
    
                if( strlen( $profile_bio ) > 5 ){
                    $short_bio = wp_trim_words($profile_bio, 5, '...' );
                }
    
            echo $short_bio;
    }

    Let us know if this takes care of it for you. :slight_smile:

    Best regards,

    James Morris

  • Katya Tsihotska

    Hi skc

    Hope you're having a wonderful day!

    If you'd like to disable registration on your site at all, you can do this at the Network Dashboard -> Settings -> Network Settings page, in the Registration Settings section choose the option "Registration is disabled"

    The above should remove registration link from the login form as well and users won't be able to register on your site themselves.

    If you want just hide the link from the login page, then try to use the following CSS:

    body.login.login-action-login #nav a:first-child, body.login-action-lostpassword #nav a:nth-child(2) {
        display: none;
    }
    body.login #nav {
    	font-size: 0;
    }
    body.login #nav a {
    	font-size: 13px;
    }

    To add the CSS you can use the Simple Custom CSS and JS. Install and Network activate it, then go to the main site dashboard -> Custom CSS & JS -> Add Custom CSS and put the above CSS here. Please, pay attention at the settings in the right sidebar.

    If you have any additional questions please let us know, we always are happy to help.

    Kind regards,
    Katya