Remove BP component links from main WP menu
Thanks a lot. It worked. I am not using the bp-default theme though, I am using the Citizen Kane theme. And it worked with that theme as well. When I created the child theme css file, I just called all six css files in the Citizen Kane theme. And in the Citizen Kane header.php file, the code to delete is on lines 54-80 and 84.
I’m now realizing that Citizen Kane’s css was inheriting css from the default theme. So it is embedding the bp-default header behind the custom header image I entered into the citizen kane header.php file. Is there anyway to stop it from pulling both header images? Can I add some css that overrides the bp-default header css?
And why can’t I just cut the code directly from the Citizen Kane header file? That would be the easiest way…
@csbarrett 1st, you should have mentioned that you were using the Citizen Kane bp-default child theme.
2nd, the only CSS it has directly imported from the bp-default theme is the adminbar.css therefore can’t fathom what you mean by “pulling both header images” and “overriding the bp-default header.css”.
3rd, perhaps @modemlooper, the theme author, can shed some light on your theme issues.
I just got the same job done on my child them (based on bp-default).
Of course, do it in Child theme, it’s safer and convinient.
I feel the easiest way is to remove the theme’s orginal nav lines, code my own nav and give it different id and class. This way can avoid inherit theme’s css
Adding bp links to admin bar should be another story, I haven’t arrive there yet
Easiest way is to remove all the li links from the header.php file except the home link and wp_list_pages( ‘title_li=&depth=1&exclude=’ . bp_dtheme_page_on_front() ); and then add a sidebar menu widget for any links you need. Next version of BP will use WP menus for the top nav so you won’t need to customize the html.
remove everything from between ul id=”nav”
<li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
<?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
<?php do_action( 'bp_nav_items' ); ?>
</ul><!-- #nav -->
@mercime, I’m not sure what was causing it, but once I created a child theme from Citizen Kane, I found that the header image from the bp-default theme was showing up behind the custom header image I uploaded (it has a transparent background so I could see behind it). I was trying different things, so I don’t know what was causing it. But sorry about the confusing post.
@modemlooper, the code you posted is what was left after I cut out lines 54-80. I also cut out line 84 as @mercime suggested. I put it back because it was in the code you posted but it didn’t seem to make a difference. Thanks both of you for your help though, it works now.
@Jenny, you might want to check out the BP-WP Navbar Menu plugin. It lets you customize the bp admin bar and you can add all your bp links under a drop-down menu (labelled “Community” by default).
- The topic ‘Remove BP component links from main WP menu’ is closed to new replies.