Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Display user country flag

@danbp

Participant

The single topic view template (loop-single-reply.php) has 2 actions hooks you can use:

do_action( 'bbp_theme_before_reply_author_details' );
do_action( 'bbp_theme_after_reply_author_details' );

In so far, the above function should work.

Try this one. Add it into your theme function to test. And if it works from there, remove it and add it to your child-theme functions.php file.

function country_flag() {
if( class_exists( 'bbPress' ) ) :
$user_id = bbp_get_reply_author_id();
$country = xprofile_get_field_data( 'country', $user_id );

	echo '<div class="country">'. $country .'</div>';
endif;
}
add_filter( 'bbp_theme_after_reply_author_details', 'country_flag' );

Activate also wp_debug in wp-config.php while testing. It could be possible you have an error somewhere who avoid the function to work properly…

If it still doesn’t work, ask for help on the bbpress support.

Skip to toolbar