Add custom sub-nav inside another custom sub-nav
-
I have 3 sub-navs. What i want to achieve is something like drop-down, I have a sub-nav as events I want that sub-nav to be parent and other to be child like drop-down menus.
Events
— Create Events
— Events List
— Events Calendar
I am using below code but nothing showingfunction bpem_events_list_tab() {
global $bp;
if (isset($bp->groups->current_group->slug)) {bp_core_new_subnav_item(array(
‘name’ => ‘Events List’,
‘slug’ => ‘events-list’,
‘parent_slug’ => $bp->groups->current_group->slug.’/events/’,
‘parent_url’ => bp_get_group_permalink($bp->groups->current_group).’events/’,
‘screen_function’ => ‘my_new_group_show_screen_list’,
‘position’ => 80));}
}
add_action(‘wp’, ‘bpem_events_list_tab’);
function my_new_group_show_screen_list() {
add_action(‘bp_template_title’, ‘bpem_create_event_title’);
add_action(‘bp_template_content’, ‘bpem_group_show_screen_content_list’);$templates = array(‘groups/single/plugins.php’, ‘plugin-template.php’);
if (strstr(locate_template($templates), ‘groups/single/plugins.php’)) {
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘groups/single/plugins’));
} else {
bp_core_load_template(apply_filters(‘bp_core_template_plugin’, ‘plugin-template’));
}
}
function bpem_create_event_title() {
echo ‘Event List’;
}function bpem_group_show_screen_content_list() {
echo “Hello World”;
}
- You must be logged in to reply to this topic.