Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Page Header & BuddyPress

Home Forums Support Page Header & BuddyPress

  • This topic has 6 replies, 3 voices, and was last updated 4 years ago by Tom.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #40623
    Stephane

    Hello Tom,

    The “Page Header” Add-on seems not to be working with a activity, groups or members page. Do you have this issue? Is it compatible?

    Thanks,
    Stephane.

    #40653
    Tom
    Lead Developer
    Lead Developer

    Hi Stephane,

    BuddyPress sets these pages up like a WordPress blog, which ignores any metabox options set on the page itself (unfortunately).

    As of right now, you would have to use GP Hooks to add a page header to these pages (I can provide code if you like).

    In the future, I plan on having a settings page that allows you to set a header easily on the Blog, and on BuddyPress pages (plus more) – just trying to figure out the best way to approach it.

    Let me know if you’d like the code for GP Hooks 🙂

    Thanks!

    #40681
    Stephane

    Thanks. Yes, I would like to have the process. Thanks.

    #41042
    Tom
    Lead Developer
    Lead Developer

    Ok, here we go 🙂

    First off, you’ll need to use GP Hooks – we’ll be working inside the “After Header” hook.

    Basically, we need to target which BuddyPress page we’re on using PHP.

    Luckily, BP provides us with some conditionals to work with: https://codex.buddypress.org/developer/bp-is-active/

    So to target the activity page, we would do this inside the hook:

    https://gist.github.com/generatepress/ba49bc497a9571038a42

    Then we would duplicate the above for the other components, the only important part is to change the name of the component on this line:

    <?php if ( bp_is_active( 'activity' ) ) { ?>

    So the above would be for the activity page.

    This would be for the groups page:

    <?php if ( bp_is_active( 'groups' ) ) { ?>

    And so on.

    It’s complicated, but achievable.

    Like I said – I hope to add options to use the Page Header addon on all of these pages.

    Let me know if you have any issues 🙂

    #41149
    Stephane

    Whooo! Thanks you very much! I try it and I give you a return.

    #242626
    Dorian

    Hey Tom,

    I bought GP a couple days ago.
    I’m trying to style the BP related pages a bit, especially the Profile Page. Eg hiding the title..
    There was no further development in this direction or?

    Best regards,
    Dorian

    #242665
    Tom
    Lead Developer
    Lead Developer

    Hi Dorian,

    It would be best if you could create a new topic with more details on what you’re trying to achieve. Then I’ll try my best to help you 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.