Skip to:

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1622 closed defect (fixed)

Genesis compatibility

Reported by: johnjamesjacoby Owned by:
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Appearance - Theme Compatibility Keywords:
Cc: daveshine


Genesis modifies some WordPress actions that bbPress 2.0 relies on to function. The attached patch (originally by Jared Atchison) attempts to make Genesis and bbPress 2.0 play nicely together in the most common configuration.

Attachments (4)

genesis.patch (4.2 KB) - added by johnjamesjacoby 10 years ago.
genesis_r2.patch (4.8 KB) - added by jaredatch 10 years ago.
genesis_lifestyle_index.png (32.3 KB) - added by jaredatch 10 years ago.
genesis_lifestyle_inner.png (69.6 KB) - added by jaredatch 10 years ago.

Download all attachments as: .zip

Change History (23)

#1 @jaredatch
10 years ago

Wow, you cranked this out in no time.

I love how you used is_bbpress() and were able to nuke my monster if statement - don't know how I missed that function. *facepalm*.

Will test this weekend.

#2 @johnjamesjacoby
10 years ago

It's untested, so thar be dragons. I suspect you can hack your way through the fog just fine. :)

#3 @daveshine
10 years ago

  • Cc daveshine added

I've implemented this in my local rc4 of the bbPress plugin - but didn't work yet! I assume the issue is from a wrong setting of the layout option??

Maybe Jared can prove/fix this? ...or someone from StudioPress can send John a copy of Genesis for testing :)

Thanx, Dave :)

#4 @daveshine
10 years ago

Another view at the Genesis layout option topic:
It's not always needed to go full width with a forum - I've seen a lot new bbPress installations just with regular sidebars in place. This also is really ok with most Genesis themes IMHO.
So if that's hard coded into this new extension included in bbPress core we surely will see a lot of user requests for changing this - only they have that overwritten by the next plugin update....

So I suggest to NOT hardcode / change any default layout for the forum part for Genesis. By default it will take the default layout option defined in the Genesis settings.
And if we give theme support for genesis layouts (and even seo options) all is ok - add_post_type_support( 'forum', 'genesis-layouts' ); -- works like a charm also for "topic"...

The only tricky issue is the forum index - we could have some option setting for the layout of forum index IMHO...?

Any other opinions on this?

#5 @nathanrice
10 years ago

Hey guys, sorry this doesn't work out of the box. Here's a couple of things you should be aware of...

As Dave mentioned, you can add layout selector support for custom post types with the following:

add_post_type_support( 'cpt-id', 'genesis-layouts' );

Also, the method for forcing a layout on an archive or single page is pretty simple. Create the archive-cpt.php file, or single-cpt.php file, and put the following in it:

add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );


JJJ, if you need a copy of Genesis, email me (nathan@…) and I'd be happy to send you one. Also, feel free to CC me on any tickets that have anything to do with Genesis.

#6 follow-up: @jaredatch
10 years ago

I plan on playing with this and doing some fine tuning this weekend.

@dave - it doesn't really have much to do with using the full width layout as it does having an option to have the *same* layout across all the forum pages (archives/single/etc), since having a layout selector for this is not feasible. Right now it's filterable, which looks promising. I will test with and without to see what works best.

#7 @johnjamesjacoby
10 years ago

Update: Jared hooked me up with a copy of Genesis to test with. Will take a look this weekend.

#8 in reply to: ↑ 6 @daveshine
10 years ago

Yes, I got this. I was originally commenting on John's code - but otherwise I don't have this coding experience yet and wanted only to report from an end users's view.

The recommended filter from Nathan is absolut best for me - didn't thought of that in the first place :)

All ok thanx for all!

#9 @johnjamesjacoby
10 years ago

Ran out of time this weekend. Will look at this week.

#10 @jaredatch
10 years ago

  • Keywords needs-testing added

Alright, I've tested this a moderate amount and it seems to be working. Most of it is the same as jjj's original patch, but with some tweaks sprinkled in.

Notably, is when BBP_Genesis is ran. Originally it wasn't being hooked, so I assume it was being executed to early and nothing was being applied. Hooking it into genesis_before (really any hook would work here) fixed that.

The second thing was how the layout option was set. Instead of using full width true/false, I changed it to pass the actual desired layout. This way users can filter it to use any of the default Genesis layouts.

#11 @jaredatch
10 years ago

The above attachments are what things look like when this theme is applied to a Genesis install using 'LifeStyle'.

For the most part, everything looks good and functions how it should be! This patch isn't going to take care of CSS tweaks that will be needed through out bbP (as seen on the inner page) - but *functionality* wise, it should get the users where they need to be.

Another thing you will see is that on the inner screenshot, the Genesis breadcrumbs are showing up. LifeStyle removes them from their default location, which is why they don't get nuked :)

#12 @johnjamesjacoby
10 years ago

(In [3496]) Introduce Genesis theme framework compatibility class.

  • Fixes error messages thrown by bbPress theme compatibility when using Genesis.
  • Moves extension loading onto 'bbp_ready' action in bbp-core-hooks.php to ensure bbPress has initialized.
  • Adds missing post data to bbp_theme_compat_reset_post() to prevent debug notices.
  • Fixes table width when in theme compatibility mode.

See #1622. Props jaredatch for original patch.

#13 @scribu
10 years ago

Sorry for coming late to the party, but why is this included in bbPress?

It seems unfair to have one commercial theme vendor get preferential treatment.

IMO, this compatibility class should either be included in the Genesis Framework itself or be released as a separate plugin.

#14 @johnjamesjacoby
10 years ago

I get your point but it isn't an endorsement, it's an acknowledgement of an incompatibility that will frustrate existing users. Including support for Genesis is not unlike including support for Akismet or BuddyPress. It's a set of private methods to help bbPress integrate into an existing installation as smoothly as possible.

Ultimately it's bbPress's theme compatibility code that is breaking existing Genesis installations. Jared contacted the guys at StudioPress and their response was they would not be updating Genesis to be bbPress compatible. It's easy enough for us to do it ourselves and deprecate it if/when Genesis adapts or bbPress doesn't need to jump through hoops to do theme compat.

Keep in mind that Genesis already exists, and it's on bbPress to be compatible with as much of what's out there as possible. To come into an existing space and force other projects to conform to something new I think reeks of arrogance. If another theme framework has incompatibilities and a member of that community volunteers time towards a solution that makes bbPress work with it, that framework will get the same "treatment" in future bbPress versions or bbPress core code will get tweaked where these extensions are no longer necessary.

Cliffnote Example: Should BuddyPress 1.5 be made aware of bbPress 2.0, or should bbPress 2.0 be made aware of BuddyPress 1.5? I don't think anyone cares just as long as it works.

#15 @scribu
10 years ago

My main concern was that this code was going to get stale pretty fast.

But you're right; bbPress is the newcomer and the class is not that big.

#16 @jaredatch
10 years ago

  • Keywords close added; has-patch needs-testing removed
  • Resolution set to fixed
  • Status changed from new to closed

jjj's [3596] has been tested on half a dozen Genesis themes and works like a charm - voilà, Genesis compatibility!

Closing and declaring victory.

#17 @johnjamesjacoby
10 years ago

(In [3500]) Remove Genesis navigation after the post loop has finished. See #1622. Props jaredatch.

#18 @johnjamesjacoby
10 years ago

  • Keywords close removed

#19 @daveshine
10 years ago

Thanx for patch guys! Works very well with bbPress 2.0 RC5!

The only question I have: How do I set the filter correctly for the layout option?
I tried different filters in my functions.php of the child theme but none of that works.
Whiche code/filter is needed for a 'content-sidebar' layout for the forum?

Thank you!

Note: See TracTickets for help on using tickets.