Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Show Categories in tabs and drop down menus at top?


@mercime
Participant

@mercime

===== TO SUPPORT WP 3 MENUS FOR BP 1.2.8 =====

1. Create a child theme of bp-default https://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/

2. Create a functions.php file in your child theme and add this:

`<?php

/* https://codex.wordpress.org/Function_Reference/add_theme_support#Navigation_Menus */

add_action( ‘init’, ‘register_my_menus’ );

function register_my_menus() {
register_nav_menus(
array(
‘primary-menu’ => __( ‘Primary Menu’ )
)
);
}

/* Removes ul class from wp_nav_menu */

function remove_ul ( $menu ){
return preg_replace( array( ‘#^

    ]*>#’, ‘#

$#’ ), ”, $menu );
}
add_filter( ‘wp_nav_menu’, ‘remove_ul’ );

?>`

3. Copy over header.php from bp-default theme and paste into child theme folder.

4. Replace line “ or the whole navigation block with code below:

`
false, ‘menu_class’ => ‘menu’, ‘theme_location’ => ‘primary-menu’, ‘fallback_cb’ => ‘display_home’ ) ); ?>

`

Adjust according to taste :-)

Skip to toolbar