Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Trying to target specific 'group' pages with css


  • rodgerfuller
    Participant

    @rodgerfuller

    Hello! I have a fresh install of wordpress and buddypress- everything is running fine.
    I am trying to customize the banner for each of the groups on the site, but I cannot see any unique group identifier classes in the rendered code. The only thing i do see is the page-id, which is the same for all buddypress pages.

    Any tips on how i might accomplish this?

    here is the group list i am working on – http://dev.followersofdestiny.com/group/

    Thanks!

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

  • danbp
    Moderator

    @danbp

    @rodgerfuller,

    this is a WP question. Anyway, you can conditionally modify the page headers by using the slug to differenciate them.
    Read here how you can do this. Simply be aware that it can be more or less theme dependant.

    however we could also just add a new class to the bp body class function!


    @rodgerfuller
    it won’t help in the short term but I have submitted a patch to core that adds the group name to the body class output so it will have ‘group-{my-group-slug}’

    Can’t see a reason why we don’t do that, so if accepted you could patch your core file in advance of the next version being released.

    even if not accepted you can quite easily filter into the WP_classes function and add your own, done in functions.php should mean it runs after BP has done it’s filtering into the WP function, this is what I do in all my functions.php for additional classes required.

    This will get you some way there:

    $classes[] = 'group-' . groups_get_current_group()->slug;

    You’ll need to filter that into the WP ‘body_class’ filter.

    If you want something a little more complex then a plugin might be better, try something like:

    BuddyGroupBanners

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Trying to target specific 'group' pages with css’ is closed to new replies.
Skip to toolbar