0
我正在使用Buddypress 1.8.1Buddypress在組主頁下添加子菜單
我需要在組主頁下添加子菜單。當我點擊主菜單時,主菜單下應該有2個子菜單。
我已經創建了子頁面。但我無法在主菜單下添加子菜單。
這樣的事情,
我正在使用Buddypress 1.8.1Buddypress在組主頁下添加子菜單
我需要在組主頁下添加子菜單。當我點擊主菜單時,主菜單下應該有2個子菜單。
我已經創建了子頁面。但我無法在主菜單下添加子菜單。
這樣的事情,
我覺得bp_core_new_subnav_item()
可能是你正在尋找的功能。你會用這樣的東西:
$args = array(
'name' => 'Snazzy Subnav', // Display name for the nav item
'slug' => 'snazzy', // URL slug for the nav item
'parent_slug' => 'home', // URL slug of the parent nav item
'parent_url' => false, // URL of the parent item
'item_css_id' => 'snazzy-id', // The CSS ID to apply to the HTML of the nav item
'user_has_access' => true, // Can the logged in user see this nav item?
'site_admin_only' => false, // Can only site admins see this nav item?
'position' => 90, // Index of where this nav item should be positioned
'screen_function' => false // The name of the function to run when clicked
);
bp_core_new_subnav_item($args)
我應該在哪裏放這段代碼? –
在您的主題的functions.php中,但請注意代碼是一個示例,您需要更改這些值。 – henrywright