Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

#5204 closed enhancement (fixed)

Add class 'page' to bp_get_the _body_class() if theme compat active

Reported by: hnla Owned by: djpaul
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch early
Cc: karmatosed, mercime

Description

Patch adds a class of 'page' to the body tag if theme compat returns true.

Reason?:

Ran across a forum post theme issue with BP rendering it's screens in a tiny narrow 300px wide element, styled on article.post, theme then set a desired size for it's layout based on '.page article.post' or '.single-post article.post' whereas this is a backwards bit of coding it did suggest the possibility of this as a re-occuring issue with themes; it's not the first time I have run across layouts relying on specific styling based on a parent class of .page or .single-post. In the case of BP we essentially say that a theme compat template is in essence a WP page yet we do not pass through any class to suggest that to third party themes ' buddypress' is useful but only if you know it exists.

I propose the patch as a means of perhaps preventing a few themes from failing to present BP screens simply due to their styling based on presumed classes. I think, but am not 100% certain, that this should have no unintended consequences?

Attachments (1)

5204.patch (635 bytes) - added by hnla 8 years ago.
Add 'page' class to body tag for theme compat templates

Download all attachments as: .zip

Change History (8)

@hnla
8 years ago

Add 'page' class to body tag for theme compat templates

#1 @r-a-y
8 years ago

  • Keywords dev-feedback added

This might have the effect of the theme overriding some of BP's loosely-named element styles. I'm just speculating at this point though.

I'm okay with it if another dev (core or theme) is okay with it.

#2 @hnla
8 years ago

This might have the effect of the theme overriding some of BP's loosely-named element styles. I'm just speculating at this point though.

Yes point taken, however thinking it over I think even if this was the case, that that's really the themes issue, BP deliberately attempts to exert as little forced styling as possible, but in the event of the scenario I describe above, a theme had wrecked the BP screens completely and for a novice they would have puzzled at how to correct; again given that in a sense that class ought to be there as this is a page it may be will help prevent a few horrendous theme issues that might be encountered.

#3 @DJPaul
8 years ago

  • Cc karmatosed mercime added
  • Milestone changed from Awaiting Review to Future Release

CC'ing karmatosed and mercime for their opinions, and bumping to future release for now.

#4 @mercime
8 years ago

it's not the first time I have run across layouts relying on specific styling based on a parent class of .page or .single-post.

+1 on adding page body class to BP pages, a practical solution for improved theme integration.

#5 @boonebgorges
8 years ago

  • Keywords early added; dev-feedback removed
  • Milestone changed from Future Release to 2.0

Let's do this right away in the 2.0 cycle so that theme authors will have plenty of time to spot problems.

#6 @DJPaul
8 years ago

Let's do this after #4929 is in

#7 @djpaul
8 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 8068:

Core: merge custom body classes with WordPress' defaults.

Until 1.9, we overrode all the custom body classes that are added to the theme, and replaced them with BuddyPress-specific classes.
With 1.9 in r7663, we manually added a couple of WordPress core classes back to fix compatibility problems with certain themes (notably, Twenty Fourteen). However, body classes added by other plugins were still removed.

This change merges BuddyPress' body classes into those provided by WordPress core, and those from any other plugins.

Fixes #4929 and #5204

Note: See TracTickets for help on using tickets.