Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hiding header, footer and sidebar in BP profile when using plugin


  • joncwhall
    Participant

    @joncwhall

    Hi,

    I’d like to be able to hide the header, footer and sidebar that appears in a member’s profile.

    I’ve had a read and have found how to do it using a child theme, but I am just using the plugin, not the theme.

    I’ve tried using the bp-custom.php file.

    Firstly with the following which I have inserted as Custom CSS (via my OptimizePress theme’s inbuilt option) on posts where I want the same things hidden.

    .banner{display:none;}
    #nav-top{display:none;}
    #nav-bottom{display:none;}
    .page-header{display:none}
    .in-page-ad {display: none}
    .op-author-info {display: none}
    .footer-content {display: none}
    .wpadminbar {display: none}

    It didn’t like this and the other things I tried here didn’t seem to do anything.

    Any help with what I can do would be greatly appreciated 🙂

    Thanks,

    Jon

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can’t do that in PHP. Well, actually you can – but you will break all the styling, as you will filter our header/footer.php files include. So basically it’s not a good idea.

    The best idea – to use a child theme. You can than even switch to that child theme for specific pages on your site. One of the ways to do that: https://premium.wpmudev.org/blog/wordpress-different-themes-for-pages/

    Another idea – do some magic with BuddyPress templates. It’s totally possible, but you will quite heavily modify them (that will complicate future maintainability).

    Also it would be easier to help you if you provided a URL to your site.


    joncwhall
    Participant

    @joncwhall

    Hi Slava,

    Thanks for the help 🙂

    Wouldn’t I need to be using the BP theme (instead of the plugin) to use child themes?

    I’ll have a go with the templates – do you know which ones I would need to modify for this please?

    A sample profile can be seen at http://www.theacademygtc.co.uk/buddy-old/test/

    Thank again for you help 🙂

    Jon

    You don’t need a BuddyPress theme, any WordPress theme will work just fine.
    You can create a child theme for your current theme and modify BuddyPress behaviour through it. Copy /plugins/buddypress/bp-templates/bp-legacy/buddypress/ to your theme (in root).

    Remove everything that you don’t need, and leave only /your-theme/buddypress/members/single directory. In that dir you should work with home.php files and others, that are relevant to you.

    But now I see that redefining BuddyPress template only won’t work as expected. You also need to create page-members.php file, where members – is the slug of you Members Directory page. It should be modified with

    if ( bp_is_user() ) {
        get_header('slim');
    } else {
        get_header();
    }

    and same for get_footer('slim') instead of the default usage. You will need to create header-slim.php and footer-slim.php files as well, and THERE you should remove all your navigation and all markup you don’t want that pages to have.

    So yeah, quite a work, but doable once you dive into that. Hopefully I gave you the direction and general idea.


    Richard Foley
    Participant

    @richardfoley

    Very useful pointers, Slava. Many thanks from another forum reader/member with a similar question. Answered well!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar