Hi,
add this code to wp-content/themes/kleo-child/functions.php
COPY CODE
function member_link_name_shortcode_func( ) {
if(is_user_logged_in()) {
if (function_exists('bp_is_active')) {
$logged_in_username = bp_get_loggedin_user_fullname();
$logged_in_link = bp_loggedin_user_domain( '/' );
$output = '<a href=".$logged_in_link.">'. $logged_in_username.' </a>';
return $output;
} elseif (class_exists('bbPress')) {
$logged_in_username = bbp_get_user_nicename(bbp_get_current_user_id());
$logged_in_link = bbp_get_user_profile_url( bbp_get_current_user_id() );
$output = '<a href=".$logged_in_link.">'. $logged_in_username.' </a>';
return $output;
}
}
}
add_shortcode('member_name','member_link_name_shortcode_func');
Then add this shortcode in the page that you want to show the username + link
[member_name]
Cheers
R.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
how to add a link to profiles? example /members/%username% /