wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



post_class › WordPress Function

Seit2.7.0
Veraltetn/v
post_class ( $css_class = '', $post = null )
Parameter: (2)
  • (string|string[]) $css_class Optional. One or more classes to add to the class list. Default empty.
    Erforderlich: Nein
    Standard: (leer)
  • (int|WP_Post) $post Optional. Post ID or post object. Defaults to the global `$post`.
    Erforderlich: Nein
    Standard: null
Definiert in:
Codex:

Displays the classes for the post container element.



Quellcode

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 ) ) ) . '"';
}