Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Spun content-home.php v 2.0

By: a guest on Dec 21st, 2013  |  syntax: PHP  |  size: 1.20 KB  |  views: 161  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /**
  3.  * @package Spun 2.0
  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 = spun_get_image( get_the_ID() );
  13.  
  14. if ( '' != $spun_image ) :
  15.         $thumb = $spun_image;
  16.         $title = '<span class="hometitle">' . esc_attr( get_the_title()) . '</span>'; /** show text in circles **/
  17. else :
  18.         $thumb = '<span class="thumbnail-title no-thumbnail">' . get_the_title() . '</span>';
  19.         $postclass = 'no-thumbnail';
  20. endif;
  21.  
  22. if ( 'no-thumbnail' != $postclass ) :
  23.         $thumb .= '<span class="thumbnail-title">' . get_the_title() . '</span>';
  24. endif;
  25. ?>
  26.  
  27. <article id="post-<?php the_ID(); ?>" <?php post_class( $postclass ); ?>>
  28.         <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  29.             <?php echo $thumb; ?>
  30.             <?php echo $title; ?></a> <!-- show text in circles -->
  31. </article><!-- #post-<?php the_ID(); ?> -->
  32.  
  33. <?php if ( $restore_widont )
  34.                 add_filter( 'the_title', 'widont' ); ?>