List of Body Classes Generated by body_class()

Does anyone know where I can get a list of all the body classes generated by body_class() for every sections and every conditions, including custom post-types, etc.?

For example, for a search result page with certain conditions (eg. logged-in), the function produces this:

Read More
<body class="search search-results logged-in admin-bar single-author two-column right-sidebar">

I need the full list for reference in creating a theme.

Cheers!

Related posts

Leave a Reply

2 comments

  1. Several classes have been added since WordPress 2.8 (when the WPEngineer post was written). I would refer directly to the body_class() Codex entry, which currently lists the following:

    • rtl
    • home
    • blog
    • archive
    • date
    • search
    • paged
    • attachment
    • error404
    • single postid-(id)
    • page-id-(page_id)
    • attachmentid-(id)
    • attachment-(mime-type)
    • author
    • author-(user_nicename)
    • category
    • category-(slug)
    • tag
    • tag-(slug)
    • page-parent
    • page-child parent-pageid-(id)
    • page-template page-template-(template file name)
    • search-results
    • search-no-results
    • logged-in
    • paged-(page number)
    • single-paged-(page number)
    • page-paged-(page number)
    • category-paged-(page number)
    • tag-paged-(page number)
    • date-paged-(page number)
    • author-paged-(page number)
    • search-paged-(page number)
    • tax-(taxonomy name) (since 3.1)
    • term-(term name) (since 3.1)
    • admin-bar (since 3.1)