Display Posts in a Grid

6/10 Press includes an easy to use helper function to add a post class to posts/entries in an archive, to convert the layout to a grid. It’s based on my flexible grid tutorial, but the work is done for you.

Note: at this time, this function only works with the Genesis Framework, since it evaluates the archive layout and selects the number of columns accordingly.

Just add one line to any archive template file:

add_filter( 'post_class', 'sixtenpress_grid_post_class' );

6/10 will handle everything else.

If you don’t want 6/10 to evaluate the layouts and just force a certain grid post class, you can use the above function in combination with the sixtenpress_column_class¬†filter. This example forces a layout to use thirds:

add_filter( 'sixtenpress_column_class', 'set_thirds' ); 
function prefix_force_grid_thirds( $class ) {
   return array( 3, 'one-third' );

…and that’s it. If your theme supports column classes already, the styling is done automatically.

Return to Six/Ten Press