Opened 13 years ago
Closed 13 years ago
#21942 closed enhancement (fixed)
Make twentytwelve_frontpage_sidebar_class() pluggable/filterable
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | Cc: |
Description
I'm making a Twenty Twelve child theme and wanted to add a third column to the sidebar. If using the third column, this plugin would still output the "two" class.
Hence, I think twentytwelve_frontpage_sidebar_class() should be pluggable. Alternately, the $classes array could be filterable, but I think that's more complicated than it needs to be.
I see no reason not to make the function pluggable, but am open to others' thoughts. I'll add a patch later today or tomorrow if no one beats me to it.
Attachments (1)
Change History (11)
#2
@
13 years ago
Discussing with Nacin in IRC #wordpress-dev channel [log https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2012-09-20&sort=asc#m460185] today, looks like we could improve this a bit:
- Move to
body_class
instead - s/twentytwelve_frontpage_sidebar_class/twentytwelve_front_page_sidebar_class
- Maybe use a more semantic sidebar class value (I'm open to suggestions — the number seems semantic to me, it's no prescribing any positioning.)
#4
follow-up:
↓ 5
@
13 years ago
Sorry, should've been clearer (just starting to get into core bug reports/patches).
Yes, I only mean on the front page template.
I think the use case is fairly straight forward: I want three columns of widgets grouped vertically. The vertical grouping is what really requires the extra widget area rather than just CSS changes to put three widgets in a row. I went ahead and made the function pluggable on my local copy (that was easy enough) and tweaked the child theme accordingly. Here's the desired result:
I could see this moving to body_class
though that would obviously entail additional changes to the stylesheet.
#5
in reply to:
↑ 4
@
13 years ago
Replying to mrwweb:
Sorry, should've been clearer (just starting to get into core bug reports/patches).
No worries, I just wanted your perspective to be sure we're on the same page.
Thanks for the info and screenshot, very helpful.
- Move to
body_class
instead- s/twentytwelve_frontpage_sidebar_class/twentytwelve_front_page_sidebar_class
- Maybe use a more semantic sidebar class value (I'm open to suggestions — the number seems semantic to me, it's not prescribing any positioning.)
1 and 3 are doable, 2 is mute point of 1.
#6
@
13 years ago
- Keywords has-patch added; needs-patch removed
Patch implements the move to body_class
and renames the class to "two-sidebars".
#7
follow-up:
↓ 8
@
13 years ago
Seems like there should be a page template check as well? We only want .two-sidebars on the front-page.php template.
#8
in reply to:
↑ 7
@
13 years ago
Replying to nacin:
Seems like there should be a page template check as well? We only want .two-sidebars on the front-page.php template.
Correct, and good point.
Hi mrwweb:
Can you explain the use case? Do you mean for the front page template?
If for inner pages, why do you need a third column?
Right now in the theme the number class selector is only used for the front page template.