Skip to content

Instantly share code, notes, and snippets.

@agusmu
Created March 22, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agusmu/e786b38aef82593710b2 to your computer and use it in GitHub Desktop.
Save agusmu/e786b38aef82593710b2 to your computer and use it in GitHub Desktop.
Genesis Framework
<?php
/* Remove Default Genesis Loop Output */
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
/* Add Image and Title */
function mycategory_grid_content() {
$img = genesis_get_image( array(
'format' => 'html',
'size' => 'home-small',
'context' => 'archive',
'attr' => genesis_parse_attr( 'entry-image' ),
) );
if ( ! empty( $img ) )
printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}
add_action( 'genesis_entry_header', 'mycategory_grid_content' );
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
/* Add Post Class */
global $mycategory_count;
function mycategory_post_class( $classes ) {
global $mycategory_count;
$mycategory_count++;
if ( 0 == $mycategory_count%2 ) {
$classes[] = 'one-half';
}
else {
$classes[] = 'one-half first';
}
$classes[] = 'post-grid';
return $classes;
}
add_action( 'post_class', 'mycategory_post_class' );
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment