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



post_class ›

Seit2.7.0
Veraltetn/v
post_class ( $class = '', $post_id = null )
Parameter: (2)
  • (string|array) $class One or more classes to add to the class list.
    Erforderlich: Nein
    Standard: (leer)
  • (int|WP_Post) $post_id 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( $class = '', $post_id = null ) {
	// Separates classes with a single space, collates classes for post DIV
	echo 'class="' . join( ' ', get_post_class( $class, $post_id ) ) . '"';
}