Skip to content

Commit

Permalink
ADD: additional post classes has-thumb/no-thumb
Browse files Browse the repository at this point in the history
  • Loading branch information
MjHead committed Jun 7, 2017
1 parent 6cf8684 commit 0d43aca
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@
// Changes "All categories" text in search-form
add_filter( 'cherry_search-select_placeholder', 'wapu_search_select_placeholder' );

add_filter( 'post_class', 'wapu_post_classes' );

/**
* Additional classes for posts.
*
* @param array $classes Default classes.
* @return array
*/
function wapu_post_classes( $classes ) {

if ( ! is_singular() ) {
$classes[] = has_post_thumbnail() ? 'has-thumb' : 'no-thumb';
}

return $classes;
}

/**
* Cherry search negative message
* @param $array
Expand Down

0 comments on commit 0d43aca

Please sign in to comment.