wpseek.com
A WordPress-centric search engine for devs and theme authors



post_class › WordPress Function

Since2.7.0
Deprecatedn/a
post_class ( $css_class = '', $post = null )
Parameters: (2)
  • (string|string[]) $css_class Optional. One or more classes to add to the class list. Default empty.
    Required: No
    Default: (empty)
  • (int|WP_Post) $post Optional. Post ID or post object. Defaults to the global `$post`.
    Required: No
    Default: null
Defined at:
Codex:

Displays the classes for the post container element.



Source

function post_class( $css_class = '', $post = null ) {
	// Separates classes with a single space, collates classes for post DIV.
	echo 'class="' . esc_attr( implode( ' ', get_post_class( $css_class, $post ) ) ) . '"';
}