wordpress add post class code example
Example 1: what is post_class()
/* Use an array to add multiple classes in post_class() function: */
<?php
$classes = array(
'class1',
'class2',
'class3',
);
?>
<div id="post-<?php the_ID(); ?>" <?php post_class( $classes ); ?>>
Example 2: what is post_class()
/* A simple way to add multiple classes to the post_class defaults, is to just write them as a string argument: */
<div <?php post_class( 'class1 class2 class3' ); ?>>