Advertisement
Guest User

Spun content-home.php

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