需要更新好友按顶栏

发布于 2025-01-03 13:29:36 字数 292 浏览 5 评论 0原文

我是 word press 的新手,正在尝试修改 Buddy Press 顶部栏。

我当前的顶部栏是

在此处输入图像描述

我想使用户区域顶部栏像

在此处输入图像描述

基本区别是将登录用户图像/飞行员放在栏的左侧。

如果可能的话,还删除右侧的访问链接。

谢谢

i am new to word press and trying to modify Buddy Press top bar.

my current top bar is

enter image description here

i want to make user area top bar like

enter image description here

the basic difference is to put the login user image/aviator on left side of bar.

and also if possible remove visit link from right side.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

懵少女 2025-01-10 13:29:36

我建议您首先创建一个自定义主题(或插件,如果您愿意),它是 bp-default 主题的子主题。请按照此处这里

从那里你可以像这样删除访问菜单:

remove_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu',        100 );

当涉及到头像时,最简单的解决方案可能是取消注册 BuddyPress 默认管理栏徽标 bp_adminbar_logo,创建一个替换函数来输出头像,最后而是注册该函数。

remove_action( 'bp_adminbar_logo',  'bp_adminbar_logo' );

function my_adminbar_logo() {
    echo '<a href="' . bp_core_get_userlink( bp_loggedin_user_id(), false, true ) . '">';
    bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' );
    echo "</a>";
}

add_action( 'bp_adminbar_logo',  'my_adminbar_logo' );

在那里,只需添加一些 CSS 即可完成:)

I suggest you start by creating a custom theme (or plugin if you prefer) that is a child theme of the bp-default theme. Follow the instructions here or here.

From there you can remove the Visit menu like so:

remove_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu',        100 );

When it comes to the avatar, the easiest solution is probably to unregister BuddyPress default admin bar logo bp_adminbar_logo, create a replacement function to output the avatar, and finally register that function instead.

remove_action( 'bp_adminbar_logo',  'bp_adminbar_logo' );

function my_adminbar_logo() {
    echo '<a href="' . bp_core_get_userlink( bp_loggedin_user_id(), false, true ) . '">';
    bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' );
    echo "</a>";
}

add_action( 'bp_adminbar_logo',  'my_adminbar_logo' );

There, just add some CSS and you're done :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文