Advertisement
Guest User

Spun content-home.php

a guest
Dec 8th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Spun
  4.  */
  5.  
  6. /*
  7.  * Get the post thumbnail; if one does not exist, try to get the first attached image.
  8.  * If no images exist, let's print the post title instead.
  9.  */
  10. $restore_widont = remove_filter( 'the_title', 'widont' );
  11. $postclass = '';
  12. $spun_image = '';
  13.  
  14. if ( '' != $spun_image ) :
  15.     $thumb = $spun_image;
  16. else :
  17.     $thumb = '<span class="thumbnail-title no-thumbnail">' . get_the_title() . '</span>';
  18.     $postclass = 'no-thumbnail';
  19. endif;
  20.  
  21. if ( 'no-thumbnail' != $postclass ) :
  22.     $thumb .= '<span class="thumbnail-title">' . get_the_title() . '</span>';
  23. endif;
  24. ?>
  25.  
  26. <article id="post-<?php the_ID(); ?>" <?php post_class( $postclass ); ?>>
  27.     <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo $thumb; ?></a>
  28. </article><!-- #post-<?php the_ID(); ?> -->
  29.  
  30. <?php if ( $restore_widont )
  31.         add_filter( 'the_title', 'widont' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement