content-home.php 947 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @package Spun
  4. */
  5. /*
  6. * Get the post thumbnail; if one does not exist, try to get the first attached image.
  7. * If no images exist, let's print the post title instead.
  8. */
  9. $restore_widont = remove_filter( 'the_title', 'widont' );
  10. $postclass = '';
  11. $spun_image = spun_get_image( get_the_ID() );
  12. if ( '' != $spun_image ) :
  13. $thumb = $spun_image;
  14. else :
  15. $thumb = '<span class="thumbnail-title no-thumbnail">' . get_the_title() . '</span>';
  16. $postclass = 'no-thumbnail';
  17. endif;
  18. if ( 'no-thumbnail' != $postclass ) :
  19. $thumb .= '<span class="thumbnail-title">' . get_the_title() . '</span>';
  20. endif;
  21. ?>
  22. <article id="post-<?php the_ID(); ?>" <?php post_class( $postclass ); ?>>
  23. <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo $thumb; ?></a>
  24. </article><!-- #post-<?php the_ID(); ?> -->
  25. <?php if ( $restore_widont )
  26. add_filter( 'the_title', 'widont' ); ?>