Skip to content

Instantly share code, notes, and snippets.

@natejacobson
Created January 16, 2015 00:39
Show Gist options
  • Save natejacobson/fccf376a805c49345a2a to your computer and use it in GitHub Desktop.
Save natejacobson/fccf376a805c49345a2a to your computer and use it in GitHub Desktop.
Throwing array error.
function spine_excerpt_style_classes( $classes ) {
global $post;
if ( !is_singular() ) {
if ( $post->post_excerpt ) {
$classes[] = "summary-excerpted";
} elseif ( strstr( $post->post_content, '<!--more-->' ) ) {
$classes[] = "summary-divided";
} elseif ( 'excerpt' === spine_get_option( 'archive_content_display' ) ) {
$classes[] = "summary-truncated";
} else {
$classes[] = "summary-unabridged";
}
return $classes;
}
}
add_filter( 'post_class', 'spine_excerpt_style_classes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment