/** * Adds custom classes to the array of post classes. * * @param array $classes Classes for the post element. * @return array */ function boardwalk_post_classes($classes) { if (1 != get_theme_mod('boardwalk_no_featured_image')) { $featured_image = boardwalk_get_image(get_the_ID(), 'boardwalk-featured-image'); } if (post_password_required() && has_post_thumbnail() || $featured_image && !is_singular()) { $classes[] = 'has-post-thumbnail'; } return $classes; }
<?php /** * @package Boardwalk */ $featured_image = get_the_post_thumbnail(get_the_ID(), 'boardwalk-featured-image'); if (1 != get_theme_mod('boardwalk_no_featured_image')) { $featured_image = boardwalk_get_image(get_the_ID(), 'boardwalk-featured-image'); } ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if ($featured_image) { ?> <div class="entry-thumbnail"> <?php echo $featured_image; ?> </div><!-- .entry-thumbnail --> <?php } ?> <header class="entry-header">