.multiple <body> class #41

justintadlock opened this Issue Sep 29, 2013 · 10 comments

4 participants


Non-singular views should have a .multiple class for easier styling. This would show on is_home(), is_archive(), or is_search(). Yeah, I know some of you've asked for this for a while. It's coming.


I like .plural to oppose .singular

is_singular() ? 'singular' : 'plural'

I like plural too just because I'm an English geek. :)


Exactly :) That should make it easy to document too.


twentyfourteen use "list-view"

    if ( is_archive() || is_search() || is_home() )
        $classes[] = 'list-view';

plural was the choice I made. This is in HC 2.0.


To briefly follow-up on this, would you consider adding is_plural() as a framework level function? I'm finding I have to define this function for every new theme because most conditions apply to all 3 mentioned views. Seems like it'd make sense to move this up to hybrid-base or hybrid-core. Comments?


Great idea! I'll definitely add that to HC.

Now, I'm wondering why I never thought to put it in a function since I use that sort of code in nearly all my themes...


Now that I'm thinking about this more, do we really need a hybrid_is_plural()? Does a !is_singular() check not really cover that?

It seems like I had some good reason that I now can't remember for doing this:

if ( is_home() || is_archive() || is_search() )

Are there any potential hangups with just using !is_singular()?


i think it's for 404 pages.


Ah, yep, that was it! I knew there was a good reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment