Get 15% off on all our plugins, themes and memberships till 4th December. Use coupon: BLACKFRIDAY2021.

BuddyDev

Search

[Resolved] Tag line

  • Participant
    Level: Initiated
    Posts: 18
    Frances Stark on #10251

    Hi Brajesh,

    full name and professional skill after space , just like name frances space and then software engineer as a skill write .
    http://forum.deviantart.com/devart/general/1816620/
    this link name nickly barkla and tagline professional tradional artist you can see it

    Thank you
    Frances

  • Keymaster
    (BuddyDev Team)
    Posts: 19833
    Brajesh Singh on #10252

    Hi Frances,
    Is it feasible that you create a profile field as tagline and then I provide you some code to show it after the name?

    That will be the simplest implementation.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Frances Stark on #10253

    Hi Brajesh,

    yes it is feasible that I create a profile field as tagline in register page you check it.
    http://www.worthyadvocates.com/register/

  • Keymaster
    (BuddyDev Team)
    Posts: 19833
    Brajesh Singh on #10254

    Thank you.

    Please add the following code to your bp-custom.php

    
    /**
     * Append tag line to the user mention name.
     *
     * @param string $mention_name name used for mention.
     *
     * @return string
     */
    function buddydev_custom_show_user_tagline( $mention_name ) {
    	$field_tagline_id = 6; // change it if you change your tagline field id.
    
    	$tagline = esc_js( xprofile_get_field_data( $field_tagline_id, bp_displayed_user_id() ) );
    
    	if ( empty( $tagline ) ) {
    		return $mention_name;
    	}
    
    	return $mention_name . "<span class='user-tagline-separator'>|</span><span class='user-tagline'>{$tagline}</span>";
    }
    
    add_filter( 'bp_get_displayed_user_mentionname', 'buddydev_custom_show_user_tagline' );
    
    

    Please do let me know if that works for you or not?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Frances Stark on #10255

    sorry please tell me bp-custom.php which file where is it exist . i didn’t understand
    Thankyou

  • Keymaster
    (BuddyDev Team)
    Posts: 19833
    Brajesh Singh on #10257

    Hi,
    Please check if there is a file named bp-custom.php in your plugins directory(wp-content/plugins)

    If it is not, you can create one(Are you familiar with php, if not, then avoid it).

    Alternatively, you can put the code in your theme’s functions.php

    You can open the functions.php of you theme and check if your theme has a

    ?>

    at the bottom of the file,

    If it is there, Please add the code just before it.

    If it is not there, You can add the code at the bottom and it will work.

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Frances Stark on #10261

    Hi Brajesh,

    yes it is working the code.

    Thank you
    Frances

  • Keymaster
    (BuddyDev Team)
    Posts: 19833
    Brajesh Singh on #10262

    You are welcome Frances!

    Best Regards
    Brajesh

The topic ‘ [Resolved] Tag line’ is closed to new replies.

This topic is: resolved