Marc Germain
asked 7 years ago

Hi,

I would like the fist post to be automaticallt ”double”.

How I can acheive this.

1 Answers
DominicStaff
answered 7 years ago

To make the fist post to be auto call "double", you can add the following code to the function.php file:

add_filter( 'post_class', 'wps_first_post_class' );
function wps_first_post_class( $classes ) {
    global $wp_query;
    if( 0 == $wp_query->current_post )
        $classes[] = 'grid-double';
        return $classes;
}

Hope this helps !

Powered by DW Question & Answer Pro