krista-m
12/20/2017 - 1:23 AM

Grid Archive Page

Adds a grid-style archive page to a Genesis Child theme like Olivia CC theme

.archive:not(.woocommerce) .entry {
	float: left;
	padding: 20px 0 20px 0;
	width: 23%;
}

.archive:not(.woocommerce) .entry:nth-child(4n+2) {
	clear: left;
}

.archive:not(.woocommerce) .entry:nth-child(4n+3),
.archive:not(.woocommerce) .entry:nth-child(4n+4),
.archive:not(.woocommerce) .entry:nth-child(4n+5) {
	margin-left: 2.6667%;
}

.archive .entry-meta,
.archive .entry-footer {
	display: none;
}


@media only screen and (max-width: 860px) {
  
  .archive .entry:not(.woocommerce) {
		text-align: center;
		width: 48%;
	}
	
	.archive:not(.woocommerce) .entry:nth-child(2n) {
		clear: left;
		margin-left: 0;
	}
	
	.archive:not(.woocommerce) .entry:nth-child(4n+4) {
		margin-left: 0;
	}
	
	.archive:not(.woocommerce) .entry:nth-child(2n+3) {
		margin-left: 4%;
	}
  
}


@media only screen and (max-width: 500px) {
  
  .archive .entry,
	.archive:not(.woocommerce) .entry {
		margin-left:0;
		margin-right: 0;
		width: 100%;
	}
	
	.archive .entry:nth-child(2n+3),
	.archive:not(.woocommerce) .entry:nth-child(4n+3),
	.archive:not(.woocommerce) .entry:nth-child(4n+4),
	.archive:not(.woocommerce) .entry:nth-child(4n+5) {
		margin-left: 0;
	}
  
}
<?php
/**
 * This file adds a custom archive page to display a post grid format
 *
 * @author    Coded Creative Themes - http://codedcreative.co
 */

//* Force full width
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );

//* Remove the entry meta in the entry header 
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );

//* Remove the post content
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );

//* Remove the post meta function
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );

//* Move post title below featured image
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_content', 'genesis_do_post_title', 9 );

genesis();