Skip to:
Content
Pages
Categories
Search
Top
Bottom

Deleting a certain part of the navigation

  • Avatar of Barry_corrigan
    barry_corrigan
    Participant

    @barry_corrigan

    Hi everyone,

    Im having a slight problem and was wondering if anyone can help :) In my member theme I have the navigation with (activity, blogs, wire, messages, blogs, settings, logout… etc etc). I am looking to delete a certain part of this nav (blogs) where can I find this I have looked everywhere and cant seem to find it.

    Thanks

    Barry

Viewing 12 replies - 1 through 12 (of 12 total)
  • Avatar of Enlightenmental1
    enlightenmental1
    Participant

    @enlightenmental1

    are you trying to disable blogs completely?

    or just remove the menu option?

    to disable blogs completely:

    rename bp-blogs.php and /bp-blogs/

    i.e. “bp-blogs.phpDISABLED”

    that will remove all menu links to blogs, you’d also want to change registrations to users only and not allow blog registrations.

    to remove that menu option from just the profile page, your looking at some core edits, or possibly adding something to bp-custom.php to remove the link from the profile screen.

    I forget off hand how to do this. I’ll re-post once I remember :-)

    Avatar of Tim Moore
    Tim Moore
    Participant

    @nullcrash

    There’s also a function you could probably use via a hook:

    bp_core_remove_nav_item($name)

    Replace $name with the name of the nav item you want removed.

    Avatar of Barry_corrigan
    barry_corrigan
    Participant

    @barry_corrigan

    Cheers guys a lot of good help there, @tim where exactly would I place that function

    thanks

    Barry

    Avatar of Tim Moore
    Tim Moore
    Participant

    @nullcrash

    I believe you can put it in /plugins/bp-custom.php (create the file if it doesn’t exist already). This is rough code, but I’m assuming you’ll want to do it like this:

    function remove_navitems()
    {
    bp_core_remove_nav_item('blogs');
    }

    add_action('bp_core_setup_nav', 'remove_navitems');

    At a first glance, that is what I’d try. Not sure if it’ll work, but that should get you going in the right direction.

    Avatar of Barry_corrigan
    barry_corrigan
    Participant

    @barry_corrigan

    Cheers Tim ill give that a go now ill get you know how I get on

    Cheers

    Avatar of Lamarant
    lamarant
    Participant

    @lamarant

    did this work? I’m looking to do the same thing. remove blog functionality and also remove it from the nav. thanks!

    Avatar of zeitweise
    zeitweise
    Participant

    @zeitweise

    We had a similar issue and chose a soft solution with CSS so we do not have to worry when upgrading.

    We placed this in the site-wide.css:

    #wp-admin-bar #bp-admin-blogs, #bp-adminbar-blogs-menu {
    display:none !important;
    }

    #my-blogs {
    display:none !important;
    }

    So the functions technically remain but are just not displayed. Works for us.

    Avatar of Lamarant
    lamarant
    Participant

    @lamarant

    Changing b”p-blogs.php” to “bp-blogs.phpDISABLED” worked for me. It removed all blog navigation elements from the display. I also modified the MU options to only allow users to register for accounts.

    Very easy. Very nice.

    Hi -

    I wanted to do something similar – remove ‘Edit Profile’ from the MY PROFILE nav section.

    I tried using this code in bp-custom.php:

    function remove_navitems()

    {

    bp_core_remove_nav_item(‘profile_edit’);

    }

    add_action(‘bp_core_setup_nav’, ‘remove_navitems’);

    That didn’t work.

    As you can see, I was just totally guessing as to the exact name of the nav item. I have no idea where to find it, or what file to examine to find the correct nav item to reference. Any help or suggestion would be greatly appreciated.

    Thanks,

    Brian

    Achieved partial success. Followed the site-wide.css advice mentioned in this forum by zeitwise and was able to eliminate the main profile ‘blogs’ nav item but the sub navigation ‘blogs’ component remains;

    found the most important clue so far in this file:

    wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php

    on lines 56 – 104

    but still elusive.

    Tried following Tim Moore suggestion of bp-custom.php but that did not do anything.

    Tried following Enlightenmental1 suggestion of renaming bp-blogs.phpDISABLED but that turned off all blogs including the home blog which I still find useful.

    This coding seems to be all over the place. Any other ideas from anyone?

    Goal: eliminate the ‘Blogs’ in the Me menu and the Options or Other User menu. Have succeeded in hiding Blogs in the Me menu but no luck for the other two.

    Thanks,

    Brian

    Avatar of Anass Rhamar
    Anass Rhamar
    Participant

    @prosellen

    Hi,

    Tim was 99% right – you just need to hook it into “plugins_loaded”. That’s it. This one works for me:

    function remove_navitems()
    {
    bp_core_remove_nav_item('blogs');
    }
    add_action('plugins_loaded', 'remove_navitems');

    Cheers

    Avatar of vusis
    vusis
    Participant

    @vusis

    thanks this works very well for me too.

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.