正在檢視 4 個帖子:1-4 (共 4 個帖子)
-
作者帖子
-
做客戶 bbPress 主題定製單,其中一個需求就是因為使用的主題已經有自帶的比較好的使用者中心現在需要重定向 bbPress 個人資料連結到自定義連結地址到的主題使用者中心。
我可以用這個簡單的程式碼來完成重定向:
add_filter( 'bbp_pre_get_user_profile_url', function() { return get_bloginfo('url').'/profile'; });
修改其中的
/profile
地址即可。很簡單,真的!
您還可以透過以下操作更改收藏夾和訂閱的預設網址:
// Replace the default link for the favorites add_filter( 'bbp_get_favorites_permalink', function() { return get_bloginfo('url').'/profile/forum-favorites'; }); // Replace the default link for subscriptions add_filter( 'bbp_get_subscriptions_permalink', function() { return get_bloginfo('url').'/profile/forum-subscriptions'; });
此回覆已被標記為私有,🔒 僅樓主及管理員可見。給 bbPress 新增全域性搜尋框:
//display bbPress search form above sinle topics and forums function rk_bbp_search_form(){ if ( bbp_allow_search()) { ?> <div class="bbp-search-form"> <?php bbp_get_template_part( 'form', 'search' ); ?> </div> <?php } } add_action( 'bbp_template_before_single_forum', 'rk_bbp_search_form' ); add_action( 'bbp_template_before_single_topic', 'rk_bbp_search_form' );
非常棒的方法。
隱藏 bbPress 的全部側邊欄
/* Hide SideBar in bbPress Profiles and Topics*/ function disable_all_widgets( $sidebars_widgets ) { if ( function_exists('is_bbpress') ) { if (is_bbpress()) { $sidebars_widgets = array(false); remove_all_actions('bp_register_widgets'); unregister_sidebar( 'bp_core_widgets' ); } } return $sidebars_widgets; } add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);
-
作者帖子
正在檢視 4 個帖子:1-4 (共 4 個帖子)
- 哎呀,回覆話題必需登入。