버디프레스랑 연동할 수는 없나요? 정보
버디프레스랑 연동할 수는 없나요?본문
글쓴이 닉네임을 클릭하면 '프로필 보기' 메뉴가 나오고,
그걸 누르면 버디프레스 프로필로 바로 가도록 하면 좋을텐데
불가능한 건가요?
추천
0
0
댓글 전체
아래 소스를 사용하는 테마 functions.php 또는 적당한 곳에 넣으시면 됩니다.
add_filter('gcboard_get_sidebars', 'custom_gcboard_get_sidebars', 10, 3);
function custom_gcboard_get_sidebars($html, $sidebars, $user_id){
if( function_exists('bp_core_get_userlink') && $user_id ){ //버디프레스 프로필 url 구하는 함수가 있으면
$sidebars['profile'] = '<a href="'.bp_core_get_user_domain( $user_id ).'">프로필보기</a>';
$html = $sidebars['profile'].$html;
}
return $html;
}
add_filter('gcboard_get_sidebars', 'custom_gcboard_get_sidebars', 10, 3);
function custom_gcboard_get_sidebars($html, $sidebars, $user_id){
if( function_exists('bp_core_get_userlink') && $user_id ){ //버디프레스 프로필 url 구하는 함수가 있으면
$sidebars['profile'] = '<a href="'.bp_core_get_user_domain( $user_id ).'">프로필보기</a>';
$html = $sidebars['profile'].$html;
}
return $html;
}
와~ 감사합니다!