Skip to content

Instantly share code, notes, and snippets.

@matiskay
Last active August 29, 2015 14:25
Show Gist options
  • Save matiskay/b82b9ecc063272aa9b44 to your computer and use it in GitHub Desktop.
Save matiskay/b82b9ecc063272aa9b44 to your computer and use it in GitHub Desktop.
Wordpress Body Classes
# Wordpress Classes
Based: https://github.com/WordPress/WordPress/blob/dfaa89d8531a3e34ec6c19b72f01e95ea3527fa0/wp-includes/post-template.php#L536
rlt:
- rlt
front page:
- home
home:
- blog
archive:
- archive
date:
- date
search:
- search
- search-results
- search-no-results
paged:
- paged
attachment:
- attachment
404:
- error404
single:
- single
- single-<post-type>
- postid-<post-id>
- single-format-<post-format>
- single-format-standard
attachment:
- attachmentid-<post-id>
- attachment-<mime-type>
archive:
- post-type-archive
- post-type-archive-<post-type>
author:
- author
- author-<user-nicename>
- author-<user-id>
category:
- category
- category-<cat-termid>
- category-<cat-slug>
tag:
- tag
- tag-<tag-slug>
- tag-<term-id>
tax:
- tax-<term-taxomomy>
- term-<term-slug>
- term-<term-id>
page:
- page
- page-id-<page-id>
- page-parent
- page-child
- parent-pageid-<parent-id>
template:
- page-template
- page-template-<page-template-without-extension>
- page-template-<template-slug>
- page-template-default
user logged in:
- logged-in
admin bar showing:
- admin-bar
- no-customize-support
page:
- paged-<page-number>
is single:
- single-paged-<page-number>
is page:
- page-paged-<page-number>
is category:
- category-paged-<page-number>
is tag:
- tag-paged-<page-number>
is date:
- date-paged-<page-number>
is author:
- author-paged-<page-number>
is search:
- search-paged-<page-number>
is post-type archive:
- post-type-paged-<page-number>
#TODO:
https://github.com/WordPress/WordPress/blob/dfaa89d8531a3e34ec6c19b72f01e95ea3527fa0/wp-includes/post-template.php#L680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment