Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display bbp_get_displayed_user_field value under users’ avatar on replies


  • Soulstudio
    Participant

    @soulstudio

    Hi,

    I’m using my code in functions.php file to store user’s location in the database and to display it on individual user profiles.

    function user_profile_bbp_location_information()	{
    	$location=bbp_get_displayed_user_field( 'location' ) ;
    	if ( ! empty($location) ) {
    		$label1 =  $rpi_options['item1_label'] ;
    		echo "<p>" ;
    		printf ( __( 'Location : ', 'bbpress' ));
    		echo $location;
    		echo"</p>" ;
    	}
    }
    add_action ('bbp_template_after_user_profile', 'user_profile_bbp_location_information') ;

    However, I would like to display this value under avatar of each user on topic posts/replies as well. I figured out I need to edit themes/childtheme/bbpress/loop-single-reply.php file but I wasn’t able to make the values appear there.

    I know there is a plugin for that but I like to use childtheme + functions.php for whatever I can + I already have working code in place.

    Any ideas?

    Thank you!

  • You must be logged in to reply to this topic.
Skip to toolbar